NYCPHP Meetup

NYPHP.org

Javascript & Sessions

Nunez, Eddy enunez at tiaa-cref.org
Tue Oct 15 12:14:16 EDT 2002


Heya folks,

	Just ran into an odd bit of coding.  I wrote some Javascript
functions to manipulate options to
a dropdown lists from a text field. i.e. function addOption( listObj, option
)

	There seems to be a problem with Javascript and Sessioning when it
comes to accessing the
document object, because when PHP initially sets the browser cookie for the
session the document
object is unaccessable?

Let me give you an example:
	1. I try my page without "session_start()".  addOption() works fine.
	2. I add the session_start() to the page, addOption() generetes an
"Object expected error",
		when I try to use it. I am guessing it can't access document
object?
		using this format: document.form1.elements[i].  (the form
was named to form1)
	3. I reload the page as is, the addOption() works fine again;
		note: I didn't touch session_start() in the code. 
	4. I delete my cookies, reload the page, and the "Object expected
error" returns.

Seems that document obj disappears only when initially setting the session
cookie? Odd.
Anyone can shed some light on this particular situation?

FYI: Using IE6,  I really hate the way IE handles Javascript Errors, Loved
the way Netscape had
a Javascript console for reviewing/locating errors.

Thanks!

-Ed



**********************************************************************
This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law.  If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies.  You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.
TIAA-CREF
**********************************************************************



More information about the talk mailing list