C#调错心得

今天遇到一个问题


image.png

数据库中没有值,检查前台代码后发现没有问题呀。
function add() {
var type_Id = "2";//大类ID
var sonType_Name = $(".sonType_Name").val();//二类名称
if (sonType_Name == "") {
layer.alert("您未填写名称");
return;
}
var sonType_Img = $("#ContentPlaceHolder1_product_Img").val();//上传图片
if (sonType_Img == "") {
layer.alert("您未上传上传图片");
return;
}
var sonType_Introduct = editor.$txt.formatText();//介绍
if (sonType_Introduct == "") {
layer.alert("您未对填写介绍");
return;
}
var seondClass_Introduce = editor.$txt.html();//内容
var reg = / /g;
var seondClass_Introduce = seondClass_Introduce.replace(reg, "");
var val = "type_Id,sonType_Img,sonType_Introduct,sonType_Name";
//大类ID,图片,介绍,子类名称
var html = "&sonType_Img=" + sonType_Img + "&sonType_Introduct=" + sonType_Introduct + "&sonType_Name=" + sonType_Name + "&type_Id=" + type_Id;
//alert(sonType_Img);
$.ajax({
type: "post",
dataType: "text",
url: "ashx/second_Editor.ashx",
data: "our=新增子类" + html+"&val="+val,
success: function (msg) {
if (msg == "成功") {
layer.msg('新增成功', { icon: 1 }, function () {
clo();
});
}
if (msg == "已存在") {
layer.alert("该类型已存在");
}
},
error: function (xml) {
alert("系统繁忙,请稍候");
}
});
}
弹了一下图片,也是有值的,这就尴尬了,最后在一般处理程序中找到了这个问题


image.png

多了个空格,找了半天错误,唉,来一发,纪念一下,下次记住
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 工厂模式类似于现实生活中的工厂可以产生大量相似的商品,去做同样的事情,实现同样的效果;这时候需要使用工厂模式。简单...
    舟渔行舟阅读 7,881评论 2 17
  • 文章分类 后台文章分类列表页模板导的详细步骤建立数据表blog_category,并添加相应的文章字段使用php ...
    JoyceZhao阅读 1,771评论 0 14
  • 单例模式 适用场景:可能会在场景中使用到对象,但只有一个实例,加载时并不主动创建,需要时才创建 最常见的单例模式,...
    Obeing阅读 2,110评论 1 10
  • 面向对象编程 1.创建,使用函数 var CheckObject = {checkName : function(...
    依米花1993阅读 402评论 0 0
  • 以下是常用的代码收集,学习用。转自豪情博客园 1. PC - js 返回指定范围的随机数(m-n之间)的公式 re...
    自由加咖啡阅读 1,027评论 0 1