I have a -link element that has href link to page, but I have to use Ajax to load that content from href -url and not redirect user to that page. How can I modify my link to
@bjelli is kinda right. But you might want to have your
e.preventDefault();
before your AJAX call or everything else you wanted to do in the first place, because you really don't want a clients old and slow browser to even try to load the initialy requested resource.
Even though some programming languages can do some magic, most scripts work from the top to the bottom of your very script.