[Coldbox 4.2] hashtag in SES URLs

I've searched here and the web and haven't found anything on this. In my site I'm building with SES URLs and a bootstrap theme (SmartAdmin/Ajax), it uses # values in the URL to Ajax lazy load page content without refreshing the whole page. DefaultEvent is "" but main.index loads the main page. It works fine while the URL is alpha.mydevsite.com/#ajax/dashboard where I have a separate handler called Ajax for those events. However on login, security is defaulting to forward to alpha.mydevsite.com/main/index#ajax/dashboard where I am getting an error on the content load because it is looking for the event main.ajax.dashboard. It's as if the IIS URL rewrite is removing the "index#". If I could always ditch the "main/index" I think I'd be ok.

Maybe I'm approaching this the wrong way and should scrap the SmartAdmin lazy loader JS and write my own Ajax calls in CF. That would certainly be cleaner but a lot of customization of the theme's code.

Thanks in advance.


Anything after a hashtag in a URL is not parsed by the server, as it is not part of the header sent to the server (Open your web inspector console and look at your request headers).

If you want to evaluate those via javascript you’ll need to do those via the `window.location.hash` variable.


Jon, thanks. The JS included in with the theme takes care of parsing the # and fetching the page content. My main issue is figuring out why it's trying to get an event called "main.ajax.dashboard" instead of just "ajax.dashboard". This may give me a hint where else to look though.

It’s most likely because your default route assigns the handler “Main”. You’ll need to check your routes file to add specific default routes for any handlers in the “ajax” directory: