I'm trying to redirect to a page in same window. Works fine in IE, but not firefox. It's getting to the redirected page because an alert I have there pops up. However when I click on 'OK' the sending page re-opens. Grateful for any suggestions.
Here is the link:
<a href="#" target="_self" onClick="javascript:transfer();">Beurla </a>
and here is the function:
function transfer()
{
var sgPath = window.location.pathname;
var vgPath;
alert(sgPath);
sgPath = sgPath.replace("_gaelic.htm", ".htm");
if (sgPath.lastIndexOf('canan_test') != -1)
{
vgPath = sgPath.replace("canan_test/gaelic_site", "canan_test");
}
else
{
vgPath = sgPath.replace("/gaelic_site/", "/");
}
alert(vgPath);
window.location.href = vgPath ;
}
Here is the link:
<a href="#" target="_self" onClick="javascript:transfer();">Beurla </a>
and here is the function:
function transfer()
{
var sgPath = window.location.pathname;
var vgPath;
alert(sgPath);
sgPath = sgPath.replace("_gaelic.htm", ".htm");
if (sgPath.lastIndexOf('canan_test') != -1)
{
vgPath = sgPath.replace("canan_test/gaelic_site", "canan_test");
}
else
{
vgPath = sgPath.replace("/gaelic_site/", "/");
}
alert(vgPath);
window.location.href = vgPath ;
}