• ASP.net2.0调试JavaScript脚本 Carlwave


    第一步:在IE的“Internet设置”中选择“高级”——“安全”——“启用集成windows身份验证”(这一步很重要!!!)
    第二步:同样在“Internet设置”中把“禁止脚本调试”的勾去掉
    第三步:用调试模式启动程序
    第四步:在vs2005的菜单选择“debut”——“Windows”——“Script Explorer”
    第五步:在“Script Explorer”窗口中双击要调试的页面
    第六步:在该文档中需要的脚本开始调试的位置设置断点
    第七步:自己操作,令程序运行到断点处,余下的就是调试程序了,
    注意,如果还是不行,那可能是缺少了一个名为“ASPCLIENTDEBUG”的cookie。设置这个cookie的方法:
    1.创建包含以下代码的 HTML 文本文件: 
    <html>
    <head>
    <script language="JavaScript">
    function set ()
    {
        var expdate = new Date(); 
        expdate.setMonth(expdate.getMonth()+6);
       alert("setting cookie \""+form1.txtName.value+"\" to \""+form1.txtValue.value+"\"");
        setCookie(form1.txtName.value, form1.txtValue.value, expdate); 
    }
    function get ()
    {
       alert("getting cookie \""+form1.txtName.value+"\"");
        var c = getCookie(form1.txtName.value);
        alert( "cookie = "+c );
        form1.txtValue.value = c;
    }
    function getCookie (sCookieName)
    {
        var sName=sCookieName+"=", ichSt, ichEnd;
        var sCookie=document.cookie;
        if ( sCookie.length && ( -1 != (ichSt = sCookie.indexOf(sName)) ) )
        {
            if (-1 == ( ichEnd = sCookie.indexOf(";",ichSt+sName.length) ) )
                ichEnd = sCookie.length;
            return unescape(sCookie.substring(ichSt+sName.length,ichEnd));
        }
        
        return null;
    }
       
    function setCookie (sName, vValue)
    {
        var argv = setCookie.arguments, argc = setCookie.arguments.length;
        var sExpDate = (argc > 2) ? "; expires="+argv[2].toGMTString() : "";
        var sPath = (argc > 3) ? "; path="+argv[3] : "";
        var sDomain = (argc > 4) ? "; domain="+argv[4] : "";
        var sSecure = (argc > 5) && argv[5] ? "; secure" : "";
        document.cookie = sName + "=" + escape(vValue,0) + sExpDate + sPath + sDomain + sSecure + ";";
    }
        
    function deleteCookie (sName)
    {
        document.cookie = sName + "=" + getCookie(sName) + "; expires=" + (new Date()).toGMTString() + ";";
    }
    </script>
    </head>
    <body>
    <form name=form1>
       cookie name:<input type="text" name="txtName" value="ASPCLIENTDEBUG"><p>
       cookie value:<input type="text" name="txtValue" value="doesn't matter"><p>
       <input type="button" value="Set Cookie" onClick="set()">
       <input type="button" value="Get Cookie" onClick="get()">
    </form>
    </body>
    </html>
    2.将此文件保存为 cookie.html。 
    3.将此文件复制到 
    c:\inetput\wwwroot
    4.在 Internet Explorer 的“地址”框中,键入: 
    http://localhost/cookie.html
    5.在 http://localhost/cookie.html 窗口中,单击“设置 Cookie”按钮。

  • 相关阅读:
    .net程序控制post数据 需登陆后保持session的方法
    简单分页查询SQL语句
    通过文本编辑器提交报从客户端中检测到有潜在危险的 Request.Form 值的错误
    Visual Studio 很卡、重置初始状态
    Jquery获取url中的参数
    Centos 6 安装桌面环境
    Jquery使用ajax实例
    一般处理程序使用session
    如何简单的发布一个react组件npm包
    BFC、IFC、GFC 和 FFC的概念
  • 原文地址:https://www.cnblogs.com/Carlwave/p/454519.html
Copyright © 2020-2023  润新知