[jQuery] Basic jQuery and Links?
Is it possible to use the "a" href attribute without the browser
changing urls? This example alerts the file and then changes the
browser to text.html
$("a.wrapper").click(function() {
alert($(this).attr('href'));
$('div#wrapwindow').load('text.html');
});
I'd like to load this into a div, which works if I use a different "a"
attributes such as rel...
$("a.wrapperWorks").click(function() {
alert($(this).attr('rel'));
$('div#wrapwindow').load('text.html');
});
Using href="#" is also undesired because the page jumps to the top in
some browsers.
So what is the "best" way to handle many text links?
Basically, I'd like the equivalent of naming an iframe and using the
target attribute. (Works, but yuck)