日期:2014-05-16 浏览次数:20378 次
//var url = window.location.search
var url = "?KnowledgeType=img&contentStr=%b2%fa%c6%b7%cd%bc%c6%ac%cb%d1%cb%f7&_KnowledgeType=xxx";
var reg = new RegExp("(?:\\?KnowledgeType
------解决方案--------------------
&KnowledgeType)=(.*?)(?=$
------解决方案--------------------
&)");
console.log(reg.exec(url)[1]);
var url = "?contentStr=%b2%fa%c6%b7%cd%bc%c6%ac%cb%d1%cb%f7&KnowledgeType=xxx&__KnowledgeType=aaaa";
var reg = new RegExp("(?:\\?KnowledgeType
------解决方案--------------------
&KnowledgeType)=(.*?)(?=$
------解决方案--------------------
&)");
console.log(reg.exec(url)[1]);