First of all, I'm not sure what Twey is saying but, in any case, adding:
onclick="i=0;return true;"
or:
onclick="i=false;return true;"
to a link will still allow the link to fire when clicked. That out of the way, we could add to the onload event(s) that fire for the page, language that adds this onclick event only to the links we desire. Something like this:
Code:
<script type="text/javascript">
function addTrue(){
var links=document.getElementsByTagName('a')
for (var i_tem = 0; i_tem < links.length; i_tem++)
if (links[i_tem].href.indexOf('pi644791070.htm')==-1&&links[i_tem].href.indexOf('javascript')==-1)
links[i_tem].onclick=function(){i=0;return true;}
}
</script>
Still, if possible, it would be better to catch the query string addition and reload and prevent it from happening a second time. This was my first idea, something like:
Code:
if (location.href.indexOf('?')!==-1)
return;
added to your function that adds the query string and reloads the page in the first place. Then, also employing the location.replace() method should not cause the multiple reloads. I'm having trouble following your code for that and perhaps '?' would not be the best character to test for but, there should be something we could use.
Bookmarks