I have the following:
$(document).ready(function() {
window.location.href='http://target.SchoolID/set?text=';
});
So if someone comes to a page with the above mentioned code using a url like:
Somepage.php?id=abc123
I want the text variable in the ready function to read: abc123
Any ideas?
you don’t need jQuery. you can do this with plain JS
and then you can just get the querystring value like this:
alert(getParameterByName('text'));also look here for other ways and plugins: How can I get query string values in JavaScript?