put the code into window.onload, for examplehtml+="<SCRIPT language=javascript>function window.onload(){var arg2=createDatePicker(\"exes_Dates\",exes_datey,exes_datem,exes_dated);}</SCRIPT>";
解决方案 »
- 大家来研究一下CSDN论坛的筛选得分贴和人的JAVASCRIPT脚本
- 求一个关于html标签的正则表达式正则表达式
- 请教一个学习javascript的问题
- [请问]有关传递参数的问题
- js获取html元素的位置
- 关于js嵌套js,不能正常使用的问题,求解决。
- 有没有好的JS混淆器,推荐一点给小弟,谢谢各位
- 用 MVC 的概念来编写前端模块~~~~~~~~~~~ 右键查看源代码!
- 有没有办法,用户离开框架时弹出一个窗口,但刷新不要弹出一个窗口?在线等,急!急!急!
- 关于两个框的写法 //
- javascript中有什么函数可以取得浏览器滚动条的位置?(很菜的问题)
- 100分相送!超级难题!javascrip的Bug??????请孟兄帮忙解答!
use "</SCR" + "IPT>" instead
html+="<html><head>
html+="<SCRIPT language=javascript>var arg2=createDatePicker(\"exes_Dates\",exes_datey,exes_datem,exes_dated);</SCRIPT>";
html+="</body><SCRIPT language=javascript src=\"dateobject.js\"></SCRIPT></html>";
document.frames("IFrame1").document.write(html);
基本上是因为document.write出来的东西不会立刻生效的。
可以这样:
<script>
document.write("<script src=aa.js><\/script>");
</script>
<script>
func_in_aajs();
</script>
ParameterssWhere Required. String that specifies where to insert the HTML text, using one of the following values: beforeBegin Inserts sText immediately before the object.
afterBegin Inserts sText after the start of the object but before all other content in the object.
beforeEnd Inserts sText immediately before the end of the object but after all other content in the object.
afterEnd Inserts sText immediately after the end of the object.
sText Required. String that specifies the HTML text to insert. The string can be a combination of text and HTML tags. This must be well-formed, valid HTML or this method will fail. Return ValueNo return value.ResIf the text contains HTML tags, the method parses and formats the text as it is inserted.You cannot insert text while the document is loading. Wait for the onload event to fire before attempting to call this method.When using the insertAdjacentHTML method to insert script, you must include the DEFER attribute in the script element. ExampleThis example uses the insertAdjacentHTML method to insert script into the page.var sHTML="<input type=button onclick=" +
"go2()" + " value='Click Me'><BR>"
var sScript='<SCRIPT DEFER>'
sScript = sScript +
'function go2(){ alert("Hello from inserted script.") }'
sScript = sScript + '</script' + '>';
ScriptDiv.insertAdjacentHTML("afterBegin",sHTML + sScript);