HighDots Forums  

Re: Nasty Firefox problem with history.back()

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Nasty Firefox problem with history.back() in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
news@chthonic.f9.co.uk
 
Posts: n/a

Default Re: Nasty Firefox problem with history.back() - 05-30-2007 , 04:34 PM






On May 30, 9:11 am, Heinrich Wolf <XXXXh.wolfX... (AT) hispeed (DOT) ch> wrote:
Quote:
n... (AT) chthonic (DOT) f9.co.uk schrieb:

Rewrite the way you call your javascript and
all will be well. Either attach the call
directly to the onclick of the images, or
use this quick hack version:

a href="#" onClick= "change();return false;">Close.gif</a

I think I understand what you say, but why does the
"return false" at the end of function change() not
serve the same purpose?

Because onclick="change();" doesn't return the false
value to the browser. What you actually wanted was
onclick="return change();" - I didn't see the return false;
stuck on the end of your original function and thought it
was easier to make 1 change rather than 2.

Quote:
[Yes there are _better_ ways of doing this, but
this solves his immediate problem].

Yes it does, and I'm most grateful for this.

I too tried to put the onClick into the image line:
img onClick="change();return false;" name="placeholder" src="...
and it works well too - as you say.

Would you mind commenting any further on "better ways"?

That your page is ONLY usable to those with
javascript, but no doubt you will encounter
THAT little problem later...

I tested my project (only now) with js switched off and the
only real problem are the many rollovers. Would you please
indicate how to modify my js code?
You can't modify JS code to cope with there being no
javascript - no code runs in that case. Rather you need
to consider your site design and make sure that those
without JS can at least use some of the site, and are
politely informed when areas that depend on it fail to
work.
Quote:
I read somewhere to put an url in place of the # in
a href="#" onClick="change();return false;"
Would that mean to load a complete new page for
each successive image? Would that be the proper way
to simulate a rollover without js?

It would be a horrible way of doing it, but it
would work. Rather, replacing the # with a url is
a way of being nice to people without JS - you
make sure the url triggers the same thing as the
javascript. Rollovers can just get dropped entirely.

Quote:
One final question: would you know a recent book
on issues involved here? I know ofwww.w3.organd
google for js - but as usual, try to find the needle
in the haystack of statements. What would be helpful
is a clever book to set a frame of today's js use.

No idea, but these approaches do get discussed here
regularly, so trawl through the archives - try searching
for NOSCRIPT and href="#"




Reply With Quote
  #2  
Old   
Heinrich Wolf
 
Posts: n/a

Default Re: Nasty Firefox problem with history.back() - 05-31-2007 , 06:11 AM






news (AT) chthonic (DOT) f9.co.uk schrieb:
Quote:
On May 30, 9:11 am, Heinrich Wolf <XXXXh.wolfX... (AT) hispeed (DOT) ch> wrote:
n... (AT) chthonic (DOT) f9.co.uk schrieb:

Rewrite the way you call your javascript and
all will be well. Either attach the call
[skipped]

Very many thanks again.
You have been very helpful re current issue
and have answered some questions I have been
"carrying about" for some time.
Heinrich Wolf


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.