Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Javascript 'history' object unavailable in Mozilla/Gecko/Netscape in strict mode??

Reply
Thread Tools

Javascript 'history' object unavailable in Mozilla/Gecko/Netscape in strict mode??

 
 
Peter Bremer
Guest
Posts: n/a
 
      07-30-2003
Hi all,

I've written this little piece of code, which doesn't seem to work in
Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found
some indication that Netscape 6+ has the same problem. Internet Explorer 6
and Opera 7 have no problems with it.

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'
'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<script>document.write (window.history.length);</script>

Mozilla returns the error "window.history has no properties".
Extensive searching on internet gave no help, even Mozilla's own DOM
Reference says nothing about it:
http://mozilla.org/docs/dom/domref/d...dow_ref25.html

Can anybody help me, and tell me how to emulate 'history.back()' without
using the history object?

Thanks, Peter


 
Reply With Quote
 
 
 
 
Peter Bremer
Guest
Posts: n/a
 
      07-30-2003

"rf" <(E-Mail Removed)> wrote in message
news:z2PVa.706$(E-Mail Removed)...
>
> "Peter Bremer" <-> wrote in message
> news:3f27bbc9$0$49110$(E-Mail Removed)4all.nl...
> > Hi all,
> >
> > I've written this little piece of code, which doesn't seem to work in
> > Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found
> > some indication that Netscape 6+ has the same problem. Internet

Explorer
> 6
> > and Opera 7 have no problems with it.
> >
> > <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'
> > 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
> > <script>document.write (window.history.length);</script>
> >
> > Mozilla returns the error "window.history has no properties".
> > Extensive searching on internet gave no help, even Mozilla's own DOM
> > Reference says nothing about it:
> > http://mozilla.org/docs/dom/domref/d...dow_ref25.html
> >
> > Can anybody help me, and tell me how to emulate 'history.back()' without
> > using the history object?

>
> <p>Press your browsers "back" button to return to where you came from</p>
>
> Cheers
> Richard.


Hehehehe.... funnyyyyy...
Okay, let me rephrase: Can anybody help me, and tell me how to emulate
'history.back()' USING JAVASCRIPT CODE, without using the history object?


 
Reply With Quote
 
 
 
 
Vjekoslav Begovic
Guest
Posts: n/a
 
      07-30-2003
"Vjekoslav Begovic" <(E-Mail Removed)> wrote in message
news:bg8f3t$l67$(E-Mail Removed)...
> Perhaps using document.location and document.refferer properties?



Sorry, window.location and document.referer, of course.


 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      07-30-2003
In post <3f27bbc9$0$49110$(E-Mail Removed)4all.nl>
Peter Bremer said...

> Can anybody help me, and tell me how to emulate 'history.back()' without
> using the history object?


every browser i've ever seen already has the ability to return to the
previous resource built in and it works which is a good thing
considering its the most used function after the humble little link.

you are trying to re-invent the wheel and it will be at best square.
you are wasting your time.

--
brucie a. blackford. 30/July/2003 10:51:34 pm kilo.
http://loser.brucies.com/
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      07-30-2003

"Peter Bremer" <-> wrote in message
news:3f27be62$0$49098$(E-Mail Removed)4all.nl...
>
> "rf" <(E-Mail Removed)> wrote in message
> news:z2PVa.706$(E-Mail Removed)...


> > > Can anybody help me, and tell me how to emulate 'history.back()'

without
> > > using the history object?

> >
> > <p>Press your browsers "back" button to return to where you came

from</p>
> >
> > Cheers
> > Richard.

>
> Hehehehe.... funnyyyyy...
> Okay, let me rephrase: Can anybody help me, and tell me how to emulate
> 'history.back()' USING JAVASCRIPT CODE, without using the history object?


You can not.

Cheers
Richard.


 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      07-30-2003

"rf" <(E-Mail Removed)> wrote in message
news:FpPVa.756$(E-Mail Removed)...
>
> "Vjekoslav Begovic" <(E-Mail Removed)> wrote in message
> news:bg8f7p$l6s$(E-Mail Removed)...
> > "Vjekoslav Begovic" <(E-Mail Removed)> wrote in message
> > news:bg8f3t$l67$(E-Mail Removed)...
> > > Perhaps using document.location and document.refferer properties?

> >
> >
> > Sorry, window.location and document.referer, of course.

>
> And where precicely is document.referer defined client side?


Belay that. You are right. Document.referer could be refered[sic] to client
side to insert the relevent link into the document *provided* the browser
provides said datum in its request for the page.

Cheers
Richard.


 
Reply With Quote
 
Peter Bremer
Guest
Posts: n/a
 
      07-30-2003

"Jacqui or (maybe) Pete" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In article <3f27be62$0$49098$(E-Mail Removed)4all.nl>, "Peter Bremer"
> <-> says...
> >
> > "rf" <(E-Mail Removed)> wrote in message
> > news:z2PVa.706$(E-Mail Removed)...
> > >
> > > "Peter Bremer" <-> wrote in message
> > > news:3f27bbc9$0$49110$(E-Mail Removed)4all.nl...

> ...
> > > <p>Press your browsers "back" button to return to where you came

from</p>
> > >

> ...
> > Okay, let me rephrase: Can anybody help me, and tell me how to emulate
> > 'history.back()' USING JAVASCRIPT CODE, without using the history

object?
> >

> I suppose you'll want to duplicate the maximize, minimise, print,
> forward, etc functions of the browser too? Why?
>
> Anyway - a javascript 'solution' is given here:
> http://www.foad.org/~abigail/HTML/Misc/back_button.html


I'm sorry Jacqui or (maybe) Pete, I don't know if you have read the message,
but I discovered that the HISTORY object seems not supported by Gecko in
strict mode. And that is exactly the object that is used in the 'solution'
you point me to.
You are right to argue the use of a history.back() function in JavaScript.
What I want to do, is create a sort of 'wizard' application, such as you
commonly see in Windows when going through complex tasks. These
applications often have a 'next' button, going to the next step, and a
'previous' button going to the previous step.
Of course I could create all kinds of complex scripts for the 'previous'
button, retrieving previously entered information from cookies, session
variables or database fields, but a simple 'history.back()' JavaScript
function also does the trick. That is, on every JavaScript-enabled browser
except for Gecko in strict mode...
Now, before resorting to writing complex code for that one set of browsers,
I was trying to find out if there was another simple way to go 'back in
history'...


 
Reply With Quote
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      07-30-2003
"Peter Bremer" <-> writes:

> I've written this little piece of code, which doesn't seem to work in
> Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found
> some indication that Netscape 6+ has the same problem. Internet Explorer 6
> and Opera 7 have no problems with it.
>
> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'
> 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
> <script>document.write (window.history.length);</script>
>
> Mozilla returns the error "window.history has no properties".


My Mozilla Firebird v0.6 has no problems with it.
Can you show a live page where it fails?

/L
--
Lasse Reichstein Nielsen - http://www.velocityreviews.com/forums/(E-Mail Removed)
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
Jacqui or (maybe) Pete
Guest
Posts: n/a
 
      07-30-2003
In article <3f27c468$0$49099$(E-Mail Removed)4all.nl>, "Peter Bremer"
<-> says...
>
> "Jacqui or (maybe) Pete" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > In article <3f27be62$0$49098$(E-Mail Removed)4all.nl>, "Peter Bremer"
> > <-> says...
> > >
> > > "rf" <(E-Mail Removed)> wrote in message
> > > news:z2PVa.706$(E-Mail Removed)...
> > > >
> > > > "Peter Bremer" <-> wrote in message
> > > > news:3f27bbc9$0$49110$(E-Mail Removed)4all.nl...

> > ...
> > > > <p>Press your browsers "back" button to return to where you came

> from</p>
> > > >

> > ...
> > > Okay, let me rephrase: Can anybody help me, and tell me how to emulate
> > > 'history.back()' USING JAVASCRIPT CODE, without using the history

> object?
> > >

....
> > http://www.foad.org/~abigail/HTML/Misc/back_button.html

>
> I'm sorry Jacqui or (maybe) Pete, I don't know if you have read the message,
> but I discovered that the HISTORY object seems not supported by Gecko in
> strict mode. And that is exactly the object that is used in the 'solution'
> you point me to.

....
The source I pointed you to uses 'history.back()' and works fine in
Mozilla 1.5b.
 
Reply With Quote
 
Peter Bremer
Guest
Posts: n/a
 
      07-30-2003
Okay everybody, thanks for your support! I've found the solution to my
problem...
It seems that this is indeed a bug in Mozilla 1.5a. I've just downloaded
the newest 'nightly build' (1.5b) and it works there...


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I replace a <frameset> with an <object> aka IE6/strict box model (and hacks). mark4asp ASP .Net 5 03-31-2007 03:51 PM
A CSS/XHTML Strict questions for centering an object Jeremy Brown HTML 2 05-15-2006 04:37 AM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
js with <object> in xhtml strict Grant Wagner Javascript 7 11-27-2004 06:59 PM
Javascript 'history' object unavailable in Mozilla/Gecko/Netscape in strict mode?? Peter Bremer Javascript 14 07-30-2003 08:36 PM



Advertisments