You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a page where there are some links for which I want/need to do a regular page load. That is, acting like ordinary links do. This basically works either by disabling boosting for those links, or adding a target="_top" attribute.
However, some of the links are parameterised, and since I'm already using htmx for parameterising links, I'd like to use it also for these. I'd hate to add javascript (or even hyperscript) to do something that htmx already does for other links.
How about, if adding target="_top" to a link would not skip boosting but instead go through all the regular processing but instead of triggering an Ajax request, just replace the location like this: window.location.assign(<target_uri>);
This can be achieved using an extension like this (which also works for client-side links that just jump to a fragment):
but I feel it wouldn't add any complexity to htmx if it did this by default, since it would just be acting on _top links instead of ignoring them like it currently does. I also feel adding target="_top" would communicate the intention better than using an extension.
How does the community think? Any suggestions? Any potential problems? Or should I just make a PR for the extension?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a page where there are some links for which I want/need to do a regular page load. That is, acting like ordinary links do. This basically works either by disabling boosting for those links, or adding a target="_top" attribute.
However, some of the links are parameterised, and since I'm already using htmx for parameterising links, I'd like to use it also for these. I'd hate to add javascript (or even hyperscript) to do something that htmx already does for other links.
How about, if adding target="_top" to a link would not skip boosting but instead go through all the regular processing but instead of triggering an Ajax request, just replace the location like this:
window.location.assign(<target_uri>);
This can be achieved using an extension like this (which also works for client-side links that just jump to a fragment):
but I feel it wouldn't add any complexity to htmx if it did this by default, since it would just be acting on _top links instead of ignoring them like it currently does. I also feel adding target="_top" would communicate the intention better than using an extension.
How does the community think? Any suggestions? Any potential problems? Or should I just make a PR for the extension?
Beta Was this translation helpful? Give feedback.
All reactions