|
-
Aug 22nd, 2006, 11:47 AM
#1
[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.
Last edited by bushmobile; Aug 22nd, 2006 at 03:28 PM.
-
Aug 22nd, 2006, 12:33 PM
#2
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.
-
Aug 22nd, 2006, 12:37 PM
#3
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.
-
Aug 22nd, 2006, 12:37 PM
#4
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.
-
Aug 22nd, 2006, 12:39 PM
#5
Re: Reload when '#text' part changes
 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. 
If not, you could try putting a randomised query string after it.
http://www.bushmobile.com/info.html?abcdef123456
-
Aug 22nd, 2006, 12:43 PM
#6
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.
-
Aug 22nd, 2006, 12:47 PM
#7
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
-
Aug 22nd, 2006, 12:48 PM
#8
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
-
Aug 22nd, 2006, 12:49 PM
#9
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
-
Aug 22nd, 2006, 12:52 PM
#10
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?
-
Aug 22nd, 2006, 12:54 PM
#11
Re: Reload when '#text' part changes
i was parsing it in the onLoad event (don't hate me)
-
Aug 22nd, 2006, 12:56 PM
#12
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.
-
Aug 22nd, 2006, 01:12 PM
#13
Re: Reload when '#text' part changes
 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?
 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?
-
Aug 22nd, 2006, 01:15 PM
#14
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.
-
Aug 22nd, 2006, 03:27 PM
#15
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|