Is it possible to have a link, once clicked, execute the href target, but not pop up a new window?
+3
A:
I presume you mean using jQuery, since you have tagged it as such. Using an ajax call will hit the page and, if you wish, you could perform actions on finish. e.preventDefault will stop the click (visiting the url) to occuring.
Something like this?
$("a#mylink").click(function(e){
var goto = $(this).attr('href'); //get the url
$.ajax({
url: goto
}); //execute the href
e.preventDefault(); //prevent click
});
neatlysliced
2010-02-03 18:43:56
Do I just set the Id of the link to myLink?
George
2010-02-03 18:53:17
You could do that, or something semantic to your page. If it already has a class or ID on there you could use that and change the jQuery.
neatlysliced
2010-02-03 19:39:13