我有一个javascript变量
var url = http://www.abc.it/it/security/security.aspx?security=pdfcompare&../securitycomparepdf/default.aspx?SecurityTokenList=blab]2]0]blab$ALL|blab]2]0]blab$ALL|blab]2]0]blab$ALL;
我需要使用jquery从中删除部分"../securitycomparepdf/default.aspx?"
,以便变量变为
http://www.abc.it/it/security/security.aspx?security=pdfcompare&SecurityTokenList=blab]2]0]blab$ALL|blab]2]0]blab$ALL|blab]2]0]blab$ALL;
有人可以建议吗?
由于
答案 0 :(得分:1)
为您制作了一个演示:http://jsfiddle.net/B3Uwj/27/(来自@tats_innit)
url = url.replace("../securitycomparepdf/default.aspx?", "");
答案 1 :(得分:1)
使用以下IS
var url = "http://www.abc.it/it/security/security.aspx?security=pdfcompare&../securitycomparepdf/default.aspx?SecurityTokenList=blab]2]0]blab$ALL|blab]2]0]blab$ALL|blab]2]0]blab$ALL";
url = url.replace("../securitycomparepdf/default.aspx?","");
alert(url);
查看实时示例here