beezee / djax

Dynamic pjax, responds to layout changes across requested pages
http://beezee.github.com/djax.html
171 stars 27 forks source link

Djax thrown off by exceptions with hyphens #45

Open paxperscientiam opened 9 years ago

paxperscientiam commented 9 years ago

Hi there beezee, from what I can tell, djax does not recognize internal link exceptions with hyphens in the page name.

$('body').djax('.updateable', ['xml-sitemap','united-nations'], transition);

Djax apparently will ignore the 'xml-sitemap' and 'united-nations'; however, partial names, such as 'xml' and 'united' do work. The problem with this is the potential for name clashes. The apparent solution is to escape the hyphen with a backwards slash.

$('body').djax('.updateable', ['xml\-sitemap','united\-nations'], transition);

This works for me, though it is not made clear that this needs to be done. I'm guessing this is common knowledge for people working with js/jquery; however, it might be helpful to bake in special character escaping into djax.