-1
一个URL查询字符串值我有一个像获得从使用JavaScript
http://something.com?acess_token=ashv6786sdjfhjd
一个URL当我点击该链接,如何让的access_token使用的Javascript该链接?
一个URL查询字符串值我有一个像获得从使用JavaScript
http://something.com?acess_token=ashv6786sdjfhjd
一个URL当我点击该链接,如何让的access_token使用的Javascript该链接?
如果你想的的access_token的价值你的意思是这样的:
ashv6786sdjfhjd
那么这里有一个快速的解决方案。希望能帮助到你!
var str = "http://something.com?acess_token=ashv6786sdjfhjd.when";
var accessToken = str.split("=")[1].split(".")[0];
console.log(accessToken);
尝试:
var Yoururl= "http://something.com?acess_token=ashv6786sdjfhjd";
var acessToken=Yoururl.split('?')[1].split('=')[1];
对于URL参数见老所以从给定链路的问题。 Get url parameter via jquery
嗨,这里描述的解决方案:http://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-get-parameters?page=1&tab=active#tab-顶部 – HubertS
请在询问之前尝试搜索 – charlietfl