首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

jquery调用ash资料没反应

2013-04-12 
jquery调用ash文件没反应function AddRow(){var myTable document.getElementByI(ctl00_ContentPlaceHo

jquery调用ash文件没反应
function AddRow()
{      
  var myTable = document.getElementByI("ctl00_ContentPlaceHolder1_zjjzzTB");        var newRowIndex = myTable.rows.length;        //添加一行       
 var newTr = myTable.insertRow();        //添加五列      
  var newTd0 = newTr.insertCell();        
var newTd1 = newTr.insertCell();       
 var newTd2 = newTr.insertCell();       
 var newTd3 = newTr.insertCell();//设置列内容和属性          newTd0.className="zztd";       
  newTd1.className="zztd";      
   newTd2.className="zztd";        
 newTd3.className="zztd";                 
  newTd0.innerHTML = newRowIndex;        
 newTd1.innerHTML = 
'<input type=text onblur="checkdata(this)" id="zjlx'+ newRowIndex+'" name="zjlx'+newRowIndex+'"/>';      
//'<input type=text id="zjbh'+ newRowIndex +'" name="zjbh'+newRowIndex+'"/>'        newTd2.innerHTML = '<select id="zjbh'+ newRowIndex +'" style="width:102px"><option>选择仓库</option></select>';      
   newTd3.innerHTML = '<input type=text  readonly="readonly" id="fzrq'+ newRowIndex +'" name="fzrq'+newRowIndex+'"/>';            
   }

function checkdata(obj)
{
var tb_id=obj.id;
var tb_text=obj.value;
        $.getJSON("DPData.ashx?id=1",null,function(json){
            $.each(json,function(i){
            alert(1)
            });
            });
}
这是我的自动添加记录行的代码,红色字体部分是添加的text控件,当我在text控件输入内容后,失去焦点触发checkdate(obj)方法,这个方法中我想用jquery调用.ashx文件来对输入的数据进行验证,看数据库中是否有输入的内容,然后返回值。
现在的问题是访问.ashx文件没反应(打了断点,不进去)

另外:一个text控件,改变它的值(onchange)时,访问.ashx文件中的方法,为什么只有第一次改变值的时候能起作用,以后改变值就进不去.ashx文件中了。  大侠们帮帮忙啊,很急啊!谢谢 jQuery JSON .NET
[解决办法]
 $.getJSON("DPData.ashx?id=1?para=" + Math.random().toString(),null,function(json){
[解决办法]
可能是缓存了,加个参数试试

  $.getJSON("DPData.ashx?id=1&r=" + new date().gettime(),null,function(json){

热点排行