2020-3-27 native JS / ZL7: parameter passing and acquisitions between native JS page

1, window.location.href = "book_chapter.htm idx1 = ?" + I; idx1 is a variable data page accepts
the window.onload = function () {
var GetRequest A = ();
var JSZ A = [ 'I '];
the console.log (JSZ)
IF (JSZ == 2) {
YBJ ();
}
};
// page acquired values are passed by value method of packaging
function GetRequest () {
var URL = location.search; // Get "?" url in the character string
var = theRequest new new Object ();
IF {(url.indexOf () = -1 "?"!)
var url.substr STR = (. 1);
STRs str.split = ( "&");
for (var I = 0; I <strs.length; I ++) {
theRequest [STRs [I] .split ( "=") [0]] = decodeURIComponent (STRs [I] .split ( "= ") [. 1]);
}
}
return theRequest;
}

Published 11 original articles · won praise 0 · Views 33

Guess you like

Origin blog.csdn.net/qq_25787687/article/details/105144588