|
@@ -31,4 +31,21 @@ function dynamicLoadScript(src){ //src相对路径
|
|
scriptObj.type = "text/javascript";
|
|
scriptObj.type = "text/javascript";
|
|
// document.getElementById(id)[0].appendChild(scriptObj);
|
|
// document.getElementById(id)[0].appendChild(scriptObj);
|
|
document.getElementsByTagName('body')[0].appendChild(scriptObj);
|
|
document.getElementsByTagName('body')[0].appendChild(scriptObj);
|
|
|
|
+}
|
|
|
|
+function changeURLPar(destiny, par, par_value){
|
|
|
|
+ var pattern = par+'=([^&]*)';
|
|
|
|
+ var replaceText = par+'='+par_value;
|
|
|
|
+ if (destiny.match(pattern)){
|
|
|
|
+ var tmp = '/\\'+par+'=[^&]*/';
|
|
|
|
+ tmp = destiny.replace(eval(tmp), replaceText);
|
|
|
|
+ return (tmp);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ if (destiny.match('[\?]')){
|
|
|
|
+ return destiny+'&'+ replaceText;
|
|
|
|
+ }else{
|
|
|
|
+ return destiny+'?'+replaceText;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return destiny+'\n'+par+'\n'+par_value;
|
|
}
|
|
}
|