Come prendere un valore GET presente nell'url ed inserirlo in un modulo html desiderato tramite JQuery
function valuePass() {
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Set Values From GET url
$("#fscf_name2").val(getParameterByName('name'));
}
valuePass();
function valuePass() {
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Set Values From GET url
$("#fscf_name2").val(getParameterByName('name'));
}
valuePass();
Commenti
Posta un commento