得到 words.js?hello,world! 参数的处理方法

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 lostinet 的 blog

很久前写的。上来帖下。

得到 words.js?hello,world! 参数的处理方法
首先有一个.html文件:
<script src="words.js?hello,word!"></script>

然后words.js的代码为:

writeparam();
function writeparam()
{
var col=document.all.tags("script");
var jsrc=col.item(col.length-1).src;
var i=jsrc.indexof("?");
var words=jsrc.substr(i+1,jsrc.length);
document.write(words);
}

---------------------------------
lostinet@chongjian.com
---------------------------------

本文关键:JavaScript,JScript,Script,参数
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top