Removing the default <a href> action

Posted by user1285198 on Stack Overflow See other posts from Stack Overflow or by user1285198
Published on 2012-04-13T23:07:52Z Indexed on 2012/04/13 23:29 UTC
Read the original article Hit count: 150

Filed under:
|
|

Is there any way to stop the page from loading the next page when someone clicks on a <a> tag instead i want it to give the href value so for example "www.google.com" and then do a jquery .load() which is like this

$(".window").load(hrefvalue);

i know i could just change all the href values to fire up a javascript function but that takes a bit of time so im just looking for the easiest way.

so i want it to do

  1. stop the page loading the next part on a <a href click.
  2. get the href value e.g http://www.google.com.
  3. and then do a jquery (.load() or $.ajax()) call for the href page.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery