Maybe just a basic question because Im new on Jquery.
I try to find any way to get data from url or called as url get parameter
Example= mysite.com/go.html?link=data Then I found this code on this forum but I confused how to use it on my html page.
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, " "));
}
How to use it? For example the url that I d=visit is mysite.com/go.html?link=example.com and I want to show the example.com in <a href="example.com">
on my html page