Fork me on GitHub

Hi! Concerning regular HTML page anchors you'd normally address like "", etc. (note .com#news-section) - How would I use/reactivate this mechanism beside JS/Clojurescript routing? (I'm using Luminus w/ reitit routing.) Any hints, or links to that approach. Couldn't find any. THANKS!


Are you looking for (set! js/location.hash "my-anchor") ?


And if not, we need a clarification on the "use/reactivate" part.


Hi you both & THX for chiming in. Such URLs in the browser fire up JS re-routing to (= blank page bc no routing for this is defined.) "sub-section" is just an HTML id within the SPA page already loaded, which I want users to jump to. You know, this standard HTML behaviour (before the age of JS routing via /#. Users need both here (long page). Hope I didn't talk nonsense.


PS: Concerning (set! js/location.hash "my-anchor" I think this would fire be same behaviour as editing the browser's URL location. (adding #abc)


It sounds to me like either Luminus or Reitit is defaulting to use location.hash for routing, and you don't want that. I think most web sites moved away from having their routing behind # quite a while ago. If you can set up your backend to respond with the SPA on several URLs, then you could probably switch to routing over to using the actual URL, and regain the original hash functionality.


Very interesting! I need to digest this. Many thanks @U07FCNURX! And @U2FRKM4TW