【发布时间】:2013-05-01 06:16:43
【问题描述】:
我希望 javascript 变量成为 url 中 ?url= 后面的内容..
例如:当前的url是
http://mywebsite.com/test/index.html?url=http://www.google.com/
所以变量必须是http://www.google.com/。
我试过这个,但它不起作用……为什么?
var url = document.URL ;
var appname = url.match(?url=(.+))[1];
谢谢。
【问题讨论】:
-
使用
location.search -
应该允许URL参数包含GET args吗?
标签: javascript html url get