怎么自动执行js代码?
<script type="text/javascript">
window.uexOnload = function() {
uexDevice.cbGetInfo=function (opCode,dataType,data){
var device = eval('('+data+')');
var connectStatus=device.connectStatus;
if(connectStatus!=null&&connectStatus.length>0){
if(connectStatus==-1){
}else if(connectStatus==0){
javascript:document.getElementById('ifrm').src='http://www.zxlmweb.cn/index.php?m=special&id=87';
}else if(connectStatus==1){
javascript:document.getElementById('ifrm').src='http://www.zxlmweb.cn/index.php?m=special&id=87';
}else if(connectStatus==2){
javascript:document.getElementById('ifrm').src='http://www.zxlmweb.cn/index.php?m=special&id=87';
}
}
}
}
</script>
<iframe src="" name="ifrm" id="ifrm" width=100% height=100% frameborder="no" ></iframe>
<input type="button" value="网络状态" onclick="uexDevice.getInfo('13');">
<div id="connectStatus"></div>
这是js代码和html代码,怎么让他自动执行js代码