由于某些原因,我只能使用静态文件,但可以远程调用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>希望高手来解答?本人白痴,希望示范代码可以写的完整些,让我方便用,不然我真的看不懂~~谢谢各位高手了!!

解决方案 »

  1.   


    找到办法了~
    document.write( " <script   language=javascript   src= http://www.xxx.com/view.php?id="   +   uid   +   "> <\/script> "); 
      

  2.   

    尽量少用 document.write();/ 动态导入js
    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');
      

  3.   

    view.html?id='""+id+'
    超链接的页面
    string id=request.queryString("id");
      

  4.   

    最好不要document.write楼主搜下 js动态加载