由于某些原因,我只能使用静态文件,但可以远程调用PHP文件。现在来了个问题,我可以设置链接里加个链接<a href = "view.html?id=2">链接2</a>然后我可以找到代码,在view.html可以用JS获取ID的值但我现在要调用一个JS我怎么把值给传进来,只能用静态页面,比如JS等。来实现下面的效果?
<script src="http://www.163.com/view.php?id=2"> </script>希望高手来解答?本人白痴,希望示范代码可以写的完整些,让我方便用,不然我真的看不懂~~谢谢各位高手了!!
<script src="http://www.163.com/view.php?id=2"> </script>希望高手来解答?本人白痴,希望示范代码可以写的完整些,让我方便用,不然我真的看不懂~~谢谢各位高手了!!
找到办法了~
document.write( " <script language=javascript src= http://www.xxx.com/view.php?id=" + uid + "> <\/script> ");
function include(src,encoding,fun)
{
var s = $C('script');
s.type='text/javascript';
s.charset=encoding; //'gb2312';
s.src = src;
var tags =$$('head');
if(typeof(fun)=='function'){
if( document.all ){
s.onreadystatechange = function(){
if(/(complete|loaded)/.test(this.readyState)){
fun(); s.onreadystatechange = null; s.parentNode.removeChild(s);
}};
}else{
s.onload = function(){ fun(); s.onload = null; s.parentNode.removeChild(s); };
}
}
tags[0].appendChild(s);
};include("http://www.xxx.com/view.php?id=" + uid ,'utf-8');
超链接的页面
string id=request.queryString("id");