`
and4walker
  • 浏览: 558934 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

张孝祥之JavaScript学习笔记

阅读更多
第一,浏览器先执行脚本程序,然后才执行HTML文本信息!
第二,主网页引用JS文件 <script src="http://www.sohu.com/text.js" type=text/javascript></script>
第三,JS的调试: (1)用alert; (2)查看浏览器左下方黄色图标;
第四,假如X没有赋值,则可以简写为 if(!x)
第五,事件如果函数中有return,调函数的时候必须也得有return;
      Sample: 禁止右键弹出菜单:写法1):
              funtion display(){ return false;}
             
              写法2)
              写法3) function display(){ document.oncontextmenu=display;  display(){return false;}  }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics