Guest User

Untitled

a guest
Apr 26th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. (6:43:16 PM) IceDragon: Browsers have a bunch of "instincts". They see you click a link - they follow it, even if you have javascript code set to run when they click the link - they still follow it. To stop that instinct I use event.preventDefault();, which you can't use in the onClick="" thing. So you can do two things: either do it my way and take the onClick="" stuff and put it where the rest of the <script></script> stuff is, or you use a link that doesn't do jack when you click it (like href="#") - something that won't make your browser load anything new.
Add Comment
Please, Sign In to add comment