LocationHashRoute Op
gives updated information about window.location.hash
Summary (oneliner)
this will return information about window.location.hash (the part after the #) in your url.
these parts of the url can be changed without reloading the browserwindow and hence may be used to carry state.
this adheres to "getstring" syntax for key-value-pairs. having multiple # is also allowed. if key-value-pairs are duplicated the last one in the string "wins".
if you define a route, only parts of the hash that match this route will be considered. use multiple ops and multiple hashes to work with urls like this: "#/scene/1#/track/5".
additionally you may set a route like this "/scene/:number" and the op will extract "5711" from this hash #/scene/5711
and store it in the output object as "number".
Edit Documentation
- Ops.Website.LocationHashRoute
- Core Op - Official cables op
- MIT
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch LocationHash Example
Youtube Video Tutorial
![](/img/play.png)
![](https://img.youtube.com/vi/hUdHnFtBTNU/mqdefault.jpg)
INPUT PORTS
pattern for url and variables (i.e. /scene/:id)
OUTPUT PORTS
an object of key-value-pairs as extracted from the hash
fires on change of the hash in the url
Patches using LocationHashRoute
Changelog
created op | ||
Ops.User.cables.LocationHash renamed to Ops.Website.LocationHash | ||
Ops.Website.LocationHash renamed to Ops.Website.LocationHashRoute | ||
bugfix | fix crash when using misformed route, show error | |
bugfix | properly set port value when loading patch |