i got a menu made with li / a, and i got jquery.load working with this. when i click on a link it loads without refreshing the page the content in a div. but what is the best way to add the filename that has to be loaded in an attribute?
this will load the page with the original link: 127.0.0.1/filetobeloaded.html for example.
<a href="filetobeloaded.html">test</a>
but if i do <a href="#" rel="filetobeloaded.html">test</a> i think this is the wrong attribute =/.
so what attribute should i use for this?
Greets,
Stefan.
Use the
hrefattribute, that’s what it is for. In the.clickfunction you just do areturn false. That will prevent the browser from redirecting to that page.Using the
hrefattribute gives you the option to let it work without javascript.