js运行url
如 <script type="text/javascript" src="http://ac.com"></script> 可运行url http://ac.com 现:
<script type="text/javascript">
var url="http://ac.com";
不在src中写代码,怎么能像上面的那样运行url呀(把代码写在此处)
</script>在线等,多谢
如 <script type="text/javascript" src="http://ac.com"></script> 可运行url http://ac.com 现:
<script type="text/javascript">
var url="http://ac.com";
不在src中写代码,怎么能像上面的那样运行url呀(把代码写在此处)
</script>在线等,多谢
var url="http://ac.com"; //这里只是建立一个字符串变量</script>
你想要运行一个文件里的,就要导入这个js文件。即你的第一种方法
你看看这篇吧。
可能是你要的东西。
http://hi.baidu.com/ligd_85/blog/item/3292701959591b7ddbb4bd69.html
<script>
window.location.href = 'http://www.csdn.net';
</script>
var ref = escape(document.referrer);
var thisURL = escape(document.URL);
var houseIdj=<? echo $_REQUEST['house_id'];?>;
document.write(unescape("%3Cscript src='/count_fcs.php?houseId="+houseIdj+"&branch=1&refUrl="+ref+"&thisUrl="+thisURL+"'%3E%3C/script%3E"));
</script>可以,只是 src中的文件不能有输出,