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

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - czh

基于MDB_ICP协议的纸币识别器与自动售货机通讯的研究 Mobile Network auto-Connection How could you login to ms sql server if you lost system admin password to setup windows auto-login Compile DLLs referenced into exe/dll 族谱软件系统的使用介绍 世界互联网正处于剧变前夜! 系统分析师 考试 DVD playable asp.net 页面事件:顺序与回传 创业还是读研? C#判断文件名是否合法 Window消息大全 关于STRONG NAME 好东西 一名25岁的董事长给大学生的18条忠告(不想虚度年华的进来) ZT SQL*PLUS命令的使用大全 如何做一个增加系统DSN的过程 ASP连接11种数据库语法总结
javascript在vs2003中调试随笔和javascript使用小总结[转载]
czh · 2006-12-02 · via 博客园 - czh

javascript在vs2003中调试随笔和javascript使用小总结[转载]

加入日期:2005-9-12 14:20:12   此文阅读:200 今日阅读:1     我要搜索文字

以前开发时很少用到javascript,现在由于项目需要得开始学习javascript

javascript的调试问题一直困扰我

有没有单步调试脚本的办法呢?

后经过人家指点,知道一简单方法随笔记录如下:

1。设置IE高级选项,把禁止调试去掉

2。让后打开你要调试的页面

3。回到vs2003中,选择工具-调试进程--选择explorer.exe--附加--选择script确定

4.选择debug-window-running document

这样就可以单步运行你的客户端脚本了


在Fitch and Mather 7.0项目中发现2个常用的javascript

1。页面启动时聚焦某一个文本框

 
例如页面中有一个文本框

<asp:textbox id="b" runat="server">start</asp:textbox>

加入下面的脚本

function window_onload()

{

       if (document.all.b)

       {

              document.all.b.select();

              document.all.b.focus();

       }

}

再添加

<body  onload="window_onload()">

2。文本框内容改变时的互清除内容

例如页面中有2个文本框

<asp:textbox id="b" onpropertychange="OnEditHandler()" runat="server"></asp:textbox>

<asp:textbox id="a" onpropertychange="OnEditHandler()" runat="server"></asp:textbox>

var inHandler=false;                                                               

function OnEditHandler()

{

       if(inHandler)

               return;

        inHandler=true;

       var srcId = event.srcElement.id;               

       if( srcId == "a" )

       {                  

          document.all.b.value = "";                  

       }

       else if( srcId == "b" )

       {                  

          document.all.a.value = "";                  

       }

         inHandler=false;

}

这样当a中内容改变时,就清空b中的文本,同样当b中内容改变时,就清空a中的文本