[Javascript] javascript object

Esther_Strom at hmco.com Esther_Strom at hmco.com
Tue Aug 7 11:23:27 CDT 2001


They're a pain in the neck, but you could also save bits of info to
cookies.

Esther



                                                                                                                       
                    Ben Curtis                                                                                         
                    <Quixote at LaMancha        To:     <javascript at LaTech.edu>                                           
                    .org>                    cc:                                                                       
                    Sent by:                 Subject:     Re: [Javascript] javascript object                           
                    javascript-admin@                                                                                  
                    LaTech.edu                                                                                         
                                                                                                                       
                                                                                                                       
                    08/07/01 11:20 AM                                                                                  
                    Please respond to                                                                                  
                    javascript                                                                                         
                                                                                                                       
                                                                                                                       





>> Also, do objects last when the user enters another page or are they
>> destroyed?
>
> If a page unloads all JavaScript objects are destroyed. The common
> workaround is to store certain variables in the frameset, if present. If
you
> don't have a frameset either you cannot store anything.

Everything that is part of the document object and many other things are
destroyed. If you want to pass a simple string or number, you can try
storing it in the window.name, but then you may get weird target results.

If you are working in an intranet setting with a limited number of browsers
to support, you might have some success storing information in the
navigator
object. For example:

var Obj = new Object();
Obj.foo = "Wack";
Obj.bar = "Turtles and wurtles";

navigator.foobar = Obj;

---> user goes to a new page, perhaps even on a different server

alert(navigator.foobar.bar);

alerts: "Turtles and wurtles";


This is far from cross-compatible. I think Netscape on a PC (all version 3
and 4, but not 6), and some IE versions on PC. I don't know of any Mac of
Linux browsers that do this. A very limited technique, but I thought I'd
share.

--
+Ben Curtis
...leveraging synergy right out of the box.






_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript







More information about the Javascript mailing list