惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - 李计刚

怎样定制图表提示? SQL学习笔记之ANSI_NULLS 要生就生双胞胎~ 如何手写代码以生成Composite图表? 在重庆访古~ Infragistics控件在VS.net 2005中使用的注意事项 UltraChart中如何自定义标签? 关于ColumnLine Chart 重庆印象! 用图表向导生成ColumnLineChart 那些逝去的美好日子! 关于SELECT执行顺序的问题! Infragistics中Custom Layer的实现(翻译) UltraChart绑定数据的问题(翻译) 韩剧已不再风光! 用颜色矩阵实现的图象反转效果 关于:GDI+FAQ的好去处! 我做的数字图象处理 我的Blog开通了!
在VS2005中调试JavaScript
李计刚 · 2009-05-20 · via 博客园 - 李计刚

    在我的项目实践中,常常要编写JavaScript以验证数据输入是否合法!一些常用的功能可以通过沿用以前的开发成果来解决,但总归会出现一些要自己编写脚本的情况。此时,完成脚本编写后,我往往通过在脚本逻辑中添加些诸如alert("A")之类的语句以测试逻辑是否运行到此处,测试下来感觉很费时,当时就想,要是能像VS2005调试程序代码样调试JavaScript,该多方便样!经过一段时间的摸索,还真让我找到了这样的解决方案,特分享大家!
     我的步骤是这样的:
     ①、打开IE的“Internet选项”,切换到“高级”栏。
     ②、在"浏览"分类中查找两个选项“禁用脚本调试(Internet Explorer)”和“显示每个脚本错误的通知”,保证“禁用脚本调试(Internet Explorer)”处于未选状态,“显示每个脚本错误的通知”处于选中状态。具体设置参见图1

     ③、在你要调试的JavaScript代码块前,添加命令行debugger;
        <script type="text/javascript">
                   function login()
                    {
                         debugger; 
                         if (document.getElementById('user').value == '1')
                         {
                           window.location.href = 'index/index_zc.html';
                         }
                        else
                        {
                           window.location.href = 'index/index_zs.html'
                        }     
                    }
        </script>
    按照上述步骤设置后,你再编译运行程序,VS2005会在设置debugger处中断等待处理,第一次设置时根据你机器的配置情况,比如你有多个Visual Studio版本都可以用来调试,会弹出图2让你选择用哪个Visual Studio版本进行调试,这里选择VS2005,然后你就可以按F10逐行调试JavaScript代码,你也可以利用命令窗口和监视窗口来观察你感兴趣内容,就这么三步,相当简单!