I am writing some JavaScript that what I essentially want to do is confirm when a user clicks a link that they do actually want to click it.
My code currently looks
Solution pulled from Original Poster question
After some more searching I have found the answer here on Stack Overflow: Returning false from click handler doesn't work in Firefox
In case anyone finds this question instead of the other, basically when using the addEventListener method of wiring events, you cant just use return false; to cancel the action, you must instead use the preventDefault() method of the event, so my code from above has now become:
Anchors[i].addEventListener("click", function (event) {
if (!confirm('Are you sure?')) { event.preventDefault(); }
}, false);