I have the following code JavaScript:
var url = window.location.href;
var link = url.split('?link=');
link[1] = "http://goo.gl/" + link[1];
link[2] = "http://goo.gl/" + link[2];
function ad(){
window.location.href = link[1];
}
function ac(){
window.open(link[2], '_blank');
}
And there is a link:
<a href="javascript:ac();" onclick="ad();">ACCESS</a>
The problem is that in some computers, the split is not working.
For exemple: If the link is mySite.com/link.html?link=wfijOp?link=atGdj
.
It should give me goo.gl/wfijOp
and goo.gl/atGdj
instead of goo.gl/undefined
and goo.gl/undefined
.
What is the problem with those computers?