I have a page with the following format : http://www.test.com/get.php?pSuccess=success
I need to retrieve the pSuccess value using jQuery.
I tried with the following code but I can't get it working..
$(document).ready(function(){
function GetURLParameter(sParam)
{
    var sPageURL = window.location.search.substring(1);
    var sURLVariables = sPageURL.split('&');
    for (var i = 0; i < sURLVariables.length; i++) 
    {
        var sParameterName = sURLVariables[i].split('=');
        if (sParameterName[0] == sParam) 
        {
            return sParameterName[1];
        }
    }
}
var success = GetURLParameter('pSuccess');
}); 
 
    