djax
djax copied to clipboard
Bind unique links or something?
Hello Beezee,
First of all, thank you a lot for this lil' plugin.
Secondly, I have an issue with it.
Indeed, I'd like to say to djax to only bind (then change via ajax method) only links on a DOM elements.
Let me clear this out if that's not (French guy, poor english here) :
I have:
<div class="menu">
<a class="menu__item menu--homepage" href="{URL homepage Site}">Go back to the homepage</a>
<ul class="menu__item">
<li><a href="{URL Portfolio}">Portfolio me</a></li>
<li><a href="{URL Contact}">Contact me</a></li>
</ul>
</div>
How can I say to djax to only bind the links from ul.menu__item but NOT a.menu--homepage ? Because I have an other template for my homepage and I don't want it to be loaded via djax.
Oh and I'm working with WordPress here.
Thank you for your concern.
Well, I've figure sth out that should works:
I added this:
if (!$(element).attr("data-djax")) { }
In the .attachClick
function.
Not sure if that's the best?
@DaPo it's a good feature request, should be supported by an option you can configure without having to modify code. I'll try to look into this soon.
@beezee yep, why not have the possibility to exclude .indexOf links AND DOM elements ? Or, on the last parameters, if there is, ONLY include DOM elements.
Should be great.
hi i found a solution for this prob but it's not a real solition :)
u can reload the page, just for index or inline "a" code where u use "rel=reloadpageopen" like a class and u sould add this code at the first
$('body').on('click', 'a[rel^=reloadpageopen], area[rel^=reloadpageopen]', function(e) { window.location= $(this).attr('href'); return false; });
@epfarki sounds legit too, but I'm waiting for something more natural from @beezee :)
Thank you anyway!