[GIVEN UP / RESOLVED] Reload when '#text' part changes
title says it all really - how would i go about reloading the page when the text following the # changes. e.g.
http://www.bushmobile.com/info.html#about
user changes it (via a link or by hand) to:
http://www.bushmobile.com/info.html#stuff
and i would like the page to reload.
Re: Reload when '#text' part changes
You can't. Any text after the hash sign should not be sent by the browser, and if it is, is ignored by the server.
Re: Reload when '#text' part changes
bugger.
ok, in that case is it possible force a browser to refresh when i click on a link.
e.g. I've got:
HTML Code:
<a href="http://www.bushmobile.com/info.html">Info</a>
and i want it to reload the page even if http://www.bushmobile.com/info.html is already showing.
Re: Reload when '#text' part changes
Might have misunderstood your question slightly. If I get you, you will need to use Javascript to manually reload the page. I am not sure however if there is an event that fires if the bookmark part of the URL changes. I don't think there is.
Re: Reload when '#text' part changes
Quote:
Originally Posted by bushmobile
bugger.
ok, in that case is it possible force a browser to refresh when i click on a link.
e.g. I've got:
HTML Code:
<a href="http://www.bushmobile.com/info.html">Info</a>
and i want it to reload the page even if
http://www.bushmobile.com/info.html is already showing.
It should do that anyway. :confused:
If not, you could try putting a randomised query string after it.
http://www.bushmobile.com/info.html?abcdef123456
Re: Reload when '#text' part changes
hmmm, that's true, it should.
what i'm actually trying to do is get the page to reload when the user clicks:
http://www.bushmobile.com/info.html#about
and then clicks:
http://www.bushmobile.com/info.html#stuff
i guess the browser doesn't bother reloading if it sees that just the bookmark has changed, so is there anyway i could force it to?
Edit: I'd love to use a query string but this god damn template thing won't let me - i'm trying to fudge it as it lets the bookmarks through.
Re: Reload when '#text' part changes
Yes, put different meaningless query strings into the target URLs.
http://www.bushmobile.com/info.html?1#about
http://www.bushmobile.com/info.html?2#stuff
Re: Reload when '#text' part changes
Eh, well, that's the only way I can think of.
Other way is to switch to a different template system :D
Re: Reload when '#text' part changes
it's just me trying to be conservative with the templates - i guess i'll just have to use one for everypage... oh well :(
Re: Reload when '#text' part changes
How is the page going to be any different if all you change is the bit that doesn't get sent to the server?
Re: Reload when '#text' part changes
i was parsing it in the onLoad event (don't hate me)
:D
Re: Reload when '#text' part changes
Hate is a subjective term.
Nevertheless, if you're using JS, might as well not reload the page at all.
Buuut, you still need proper separate pages, as well as one all-in-one JS thingo. Otherwise you exclude people who can't run Javascript.
Re: Reload when '#text' part changes
Quote:
Originally Posted by penagate
Nevertheless, if you're using JS, might as well not reload the page at all.
at the moment my text is in span tags which are all set to display:none and based on the value after the # i was showing the relevant one using JS. Bearing in mind that all i have control over is the html on the page i couldn't think of another way - how will i know which one i should show?
Quote:
Originally Posted by penagate
Buuut, you still need proper separate pages, as well as one all-in-one JS thingo. Otherwise you exclude people who can't run Javascript.
what do you mean by all-in-one thingo?
Re: Reload when '#text' part changes
All in one being the approach you are using now.
What you could do, and this is starting to get ugly, is add event listeners to each anchor element with a #reference, when the page loads, and then in that event handler, show and hide the appropriate content elements.
Re: Reload when '#text' part changes
meh, i think i'm gonna give up - just gonna use the Anchor tags as they were meant to be used - cheers for the input, pen.