如何从JavaScript中读取通过查询字符串传递的值 [英] How to read a value from javascript which is passed through query string

查看:64
本文介绍了如何从JavaScript中读取通过查询字符串传递的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

Hi friends,

<script src="check.js?id=Test" type="text/javascript"></script>



从上面的查询字符串中,我必须读取该ID.
谁能告诉我如何从该check.js读取查询字符串值?
请紧急.
在此先感谢



from the above query string I have to read that id.
can anyone please tell me how to read that query string value from that check.js

It''s Urgent please.
Thanks in advance

推荐答案

我不相信您可以在这里做您想做的事情.
脚本源标记只是脚本源文件的路径. Querystring参数是HtmlRequest的一部分,我认为不能像这样传递到您的脚本src标记中.
I don''t believe you can do what you are trying to do here.
The script source tag is simply a path to the script source file. Querystring arguments are part of an HtmlRequest and I don''t think can be passed in to your script src tag like that.


这篇关于如何从JavaScript中读取通过查询字符串传递的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆