开发者

Get a URL argument variable with Javascript

开发者 https://www.devze.com 2023-03-22 03:54 出处:网络
How do I get a $_GET[] argument with开发者_运维技巧 JavaScript? http://www.example.com/?what=this

How do I get a $_GET[] argument with开发者_运维技巧 JavaScript?

http://www.example.com/?what=this

I want to get the value of "what" ...


You can get the raw string like this:

window.location.search

E.g., http://google.com/?whatIs=up

gives you ?whatIs=up

And then parse through it to get the different values for the different parameters.

0

精彩评论

暂无评论...
验证码 换一张
取 消