Say for example I had had page with the url of:
foo.php?bar='blob'
Is it possible to get the value of blob?
For example:
xmlhttp.open("GET","new_film_pro.php?x="+blob,true);
Thanks
Say for example I had had page with the url of:
foo.php?bar='blob'
Is it possible to get the value of blob?
For example:
xmlhttp.open("GET","new_film_pro.php?x="+blob,true);
Thanks
You can use this function: http://www.netlobo.com/url_query_string_javascript.html
If you are using jsp then
var blob="<%request.getParameter('bar')%>";
xmlhttp.open("GET","new_film_pro.php?x="+blob,true);
You should already know the value, if your xmlhttp call includes it, just parse the string
EDIT
function getArgs(url) {
var args = new Object();
var query = url.split("?")[1];
var pairs = query.split("&");
for (var i = 0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('=');
if (pos == -1) continue;
var argname = pairs[i].substring(0, pos);
var value = pairs[i].substring(pos + 1);
args[argname] = unescape(value);
}
return args;
}
var args = getArgs("testing.php?foo=bar");
txtValue.value = args.foo;