懒码农。。。。。。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

转自:http://hi.baidu.com/ÎÄÐĵñÁú113/blog/item/c558ce51be728a030df3e375.html

 

 

例://任意点击时关闭该控件
function document.onclick(){
with(window.event.srcElement){
     if (tagName != "INPUT" && getAttribute("Author") != "tiannet")
         tiannetHideControl();
}
}
这样会报missing ( before function parameters。
正确写法:
document.onclick=function(){
with(window.event.srcElement){
     if (tagName != "INPUT" && getAttribute("Author") != "tiannet")
         tiannetHideControl();
}
}

今天在写留言板模块时,定义js下的函数时出错,经过百度,查阅原因是Myeclipse中的js的方法定义都是按照以下的形式:

     方法返回类型 . 方法名称 =function(){   .............}


 

posted on 2011-10-10 10:41  阿彬  阅读(752)  评论(0编辑  收藏  举报