I've been searching online for an answer to this but I can't seem to find anything which can help.
I was wondering if its possible to open a index.html file with an extension after the .html
(for example it would open a file like this - index.html?lc=uk) automatically when you would double click the file or when you click on a link which connects to that file.
Hope that makes sense.
If anyone could help would be much appreciated.
Regards, Seb
user2072826
function setGetParameter(paramName, paramValue)
{
var url = window.location.href;
if (url.indexOf(paramName + "=") >= 0)
{
var prefix = url.substring(0, url.indexOf(paramName));
var suffix = url.substring(url.indexOf(paramName));
suffix = suffix.substring(suffix.indexOf("=") + 1);
suffix = (suffix.indexOf("&") >= 0) ? suffix.substring(suffix.indexOf("&")) : "";
url = prefix + paramName + "=" + paramValue + suffix;
}
else
{
if (url.indexOf("?") < 0)
url += "?" + paramName + "=" + paramValue;
else
url += "&" + paramName + "=" + paramValue;
}
window.location.href = url;
}
and then in the body tag:
<body onload="setGetParameter('lc', 'uk');">
This has worked but the problem is that it keeps refreshing the page constantly. Is there a way to stop the refreshing?