我的DataGrid中有一列HyperLinkColumn,我URL格式字符串中加入如下代码:
javascript:var win= launchCenter('OutStor1Edit.aspx?id={0}', 'center', 600, 370); window.Close();其实launchCenter()的函数如下:
 function launchCenter(url, name, height, width) 
     { 
         var str = "height=" + height + ",innerHeight=" + height; 
           str += ",width=" + width + ",innerWidth=" + width; 
         if (window.screen)
          { 
            var ah = screen.availHeight - 30; 
            var aw = screen.availWidth - 10; 
             var xc = (aw - width) / 2; 
            var yc = (ah - height) / 2; 
                str += ",left=" + xc + ",screenX=" + xc; 
                str += ",top=" + yc + ",screenY=" + yc; 
           } 
          return window.open(url, name, str); 
        
       
    } 但是每次我点击链接的时候,虽然窗体弹了出来,但是老出现一个脚本错误为:
行:1
字符:84
错误:对象不支持此属性或方法
代码:0
URL:http://localhost/ems/OutStor1.aspx

解决方案 »

  1.   

    自己在 JS的代码里加个  debugger ,调试一下
      

  2.   

    请问一下:js里面如何加入debuggerne
      

  3.   

    你在IE选项里,不要选中“禁止脚本调试”,然后在VS里就可以开始脚本调试了。
      

  4.   

    for(int i=0;i<5;i++) 
              {
             // 打印变量 i
             Debug.write("loop index is " + i);
             // 等待重新开始
             debugger;
                 }
    我在js里面加入了如上的代码,但是却弹出了错误,说for那行,结尾处要加上;
    不可思意?
    是不是我加入的方式不对呢?