Solved

location.hash problem with IE

Posted on 1997-11-05
2
215 Views
Last Modified: 2008-02-26

Why ?

why IE3.0 reload a document when using location.hash ='top' ?
(IE4.0 NE3.0 and NE4.0 doesn't do that !!!)

more details of my problem :

I have two frames (leftFrame and rightFrame)
on leftFrame there are n images whith
onMouseOver="parent.rightFrame.location = 'file.htm#'+n
(REM this doesn't work : onMouseOver="parent.rightFrame.location.hash=n)

on rightFrame (long document)  we found :
<A NAME='1'></A>
text
text
text
<A NAME='2'></A>
text
text
text
....
...
<A NAME='n'></A>

when passing mouse over a picture the rightFrame
go to the specified anchor....
work great with IE but only with localfiles
(because IE3 always call the server for each mouseOver, wich can take a long time !!!)

Do you know a trick for that problem ?
Thanks for your help !

Pierre Bastoul
0
Comment
Question by:pbastoul
2 Comments
 
LVL 10

Accepted Solution

by:
kollegov earned 100 total points
ID: 1272532
Why? because you use:
onMouseOver="parent.rightFrame.location =
           'file.htm#'+n
And MIE3.0 isn't so smart as Netscape to
determine that this is a SAME html.

Unfortuantly MIE do not support
location.hash property as well as other ones
so you can't use other way to
to do this.

No way, sorry...

You can check browser once whil loading:

var browserOK;
if(navigator.appName.indexOf("Internet Explorer"))
  if(navigator.appVersion>=4) {browserOK=true;}
if(navigator.appName.indexOf("Netscape"))
  if(navigator.appVersion>=3) {browserOK=true;}

and later youse this
broserOK variable

onMouseOver="if(broserOK) parent.rightFrame.location='file.htm#'+n"

So, your script wouldn't rload document in MIE :(
0
 

Author Comment

by:pbastoul
ID: 1272533
what about a 'document.search'  of JS ?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now