随笔分类 -  javascript

摘要:JavaScript执行引擎并非一行一行地分析和执行程序,而是一段一段地分析执行的。而且在分析执行同一段代码中,定义式的函数语句会被提取出来优先执行。函数定义执行完后,才会按顺序执行其他代码。先看看两个例子:例子1:var hello = function(){alert('hello,zhangsan');}hello();//第一次调用,输出“hello,zhangsan”var hello = function(){alert('hello,lisi');}hello();//第二次调用,输出“hello,lisi”例子2:function hello() 阅读全文
posted @ 2013-07-29 17:16 周文 阅读(164) 评论(0) 推荐(0)
摘要:一、Iframe篇//&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&&//父对象得到子窗口的值//ObjectID是窗口标识,ContentID是元素IDfunction GetValue(ObjectID,ContentID){ varIsIE = (navigator.appNam 阅读全文
posted @ 2013-07-16 22:33 周文 阅读(532) 评论(0) 推荐(0)
摘要:如果使用window.showModalDialog()打开子窗口的话,可以用parent.function()调用父窗口的方法。例如: var RtnVal = window.showModalDialog(sUrl, this, "dialogHeight:255px;dialogWidth:605px;status:no;help:no"); if (RtnVal == '1') (若窗口成... 阅读全文
posted @ 2009-06-03 09:40 周文 阅读(321) 评论(0) 推荐(0)
摘要:1.Date 属性(1): constructor 所建立对象的函数参考 prototype 能够为对象加入的属性和方法 方法(43): getDay() 返回一周中的第几天(0-6) getYear() 返回年份.2000年以前为2位,2000(包含)以后为4位 getFullYear() 返回完整的4位年份数 getMonth() 返回月份数(0... 阅读全文
posted @ 2009-04-22 10:03 周文 阅读(250) 评论(0) 推荐(0)
摘要:window.open ("page.html", "newwindow", "height=100, width=400, toolbar= no, menubar=no, scrollbars=no, resizable=no, location=no, status=no,top=100,left=300") height:page.html的高度 width:page.h... 阅读全文
posted @ 2009-04-22 09:36 周文 阅读(286) 评论(0) 推荐(0)
摘要:父窗口调用iframe子窗口方法 myFrame.window.functionName(); iframe子窗口调用父窗口方法 parent.functionName(); 父窗口页面 子窗口页面 阅读全文
posted @ 2009-04-10 14:56 周文 阅读(806) 评论(0) 推荐(0)