execScript Method
--------------------------------------------------------------------------------Executes the specified script in the provided language.SyntaxvReturn = window.execScript(sExpression, sLanguage)
ParameterssExpression Required. String that specifies the code to be executed.
sLanguage Required. String that specifies the language in which the code is executed. The language defaults to Microsoft® JScript®. Return ValueThis method always returns null.ResScript executed through the execScript method can access all global variables available to the calling script. This can be useful when you want the functionality of another scripting language that would not otherwise be available in JScript, such as the Microsoft Visual Basic® Scripting Edition (VBScript) MsgBox function.Standards InformationThere is no public standard that applies to this method.
--------------------------------------------------------------------------------Executes the specified script in the provided language.SyntaxvReturn = window.execScript(sExpression, sLanguage)
ParameterssExpression Required. String that specifies the code to be executed.
sLanguage Required. String that specifies the language in which the code is executed. The language defaults to Microsoft® JScript®. Return ValueThis method always returns null.ResScript executed through the execScript method can access all global variables available to the calling script. This can be useful when you want the functionality of another scripting language that would not otherwise be available in JScript, such as the Microsoft Visual Basic® Scripting Edition (VBScript) MsgBox function.Standards InformationThere is no public standard that applies to this method.
解决方案 »
- ie6下更换div背景图片为GIF格式, 不显示动画
- javascript隐藏域赋值问题
- JavaScript棘手问题
- 网站后台使用什么js框架?
- 菜鸟求助简单问题 100分等你拿
- 登录会员后自动刷新页面问题??
- showModalDialog窗口页面中的iframe页面不能后退?!
- 怎么实现把中文转换成带%的那种编码?
- 请问htc中,PROPERTY 的INTERNAME属性怎么用啊?
- document.getElementById("yypl_" + small_id).innerHTML 已成功赋值,但页面没更新,什么原因!
- 正则取input type="text"中的value
- 用document.write写script标记无效
script.language="javascript"
script.type = "text/javascript";
script.src="a.js";
document.body.appendChild(script);
是由一个php生成的,但效果和.js文件差不多吧
如题,另一段代码和调用的这段代码不在同一个文件中。
如:
<script language="javascript">
function doit()
{
载入并运行xxxx文件(此文件内容也是javascript代码)
setTimeout("doit()",5000);
}
doit();
</script>
**/1:为什么要这么做,你可以直接把文件在,引用之前包含进来,比方:
<script type="text/javascript" src="youJS.js">
<script language="javascript">
function doit()
{
载入并运行xxxx文件(此文件内容也是javascript代码)
setTimeout("doit()",5000);
}
doit();
</script>2:如果一定要这样做,也可以结合服务端脚本语言来做--直接输出即可,比方:
<script language="javascript">
function doit()
{
<?php echo "载入并运行xxxx文件(此文件内容也是javascript代码)";?>
//载入并运行xxxx文件(此文件内容也是javascript代码)
setTimeout("doit()",5000);
}
doit();
</script>
to hansonboy
是由一个php生成的,但效果和.js文件差不多吧
*/<script language="javascript">
function doit()
{
<?php echo "alert('Hello world!');";?>
//载入并运行xxxx文件(此文件内容也是javascript代码)
setTimeout("doit()",5000);
}
doit();
</script>
{
var xh = new ActiveXObject("Microsoft.XMLHTTP");
xh.open( "url", false );
xh.send();
if( xh.status == 200 )
{
eval( xh.responseText);
}
setTimeout("doit()",5000);
}
doit();//即兴写的,你自己调一下。