Re: oops javascript error
| From: | Gabor Hojtsy | Date: | Sat, 23 Feb 2002 14:00:42 +0000 |
| Subject: | Re: oops javascript error | ||
| References: | 1 | Groups: | php.doc.chm |
| Request: | Send a blank email to php-doc-chm+get-33@lists.php.net to get a copy of this message | ||
> this seems not to be ie6 related but an issue in general.
> i can hardly reproduce this but what i suppose is the following:
> the error occous in the following line:
> ...
> <body onLoad="if(parent.nbuff) {parent.displayNotes()}">
> ...
>
>
> .displayNotes() is not set but .nbuff is. the problem is, that
> onLoad isn't triggered after loadig the usernotes but after
> loading the actual content, thus if loading of the usernotes
> takes longer than loading of the content displayNotes() will
> not be defined when it gets called.
displayNotes() is defined in the heading after the _script.js is
called, which writes in the nbuff for user note inclusion. Maybe
if we change the order of the <script> tags, displayNotes() will
be allways defined first than the _script.js is called.
> i can reproduce this most simple with a manual page that has many
> user notes (which also strengthens my assumption) which take
> longer to load. to catch this you should query the readyState
> property of parent.nbuff.body first and/or install a
> onReadyStateChange listener for it.
> look at http://msdn.microsoft.com/library/default.asp?
> url=/workshop/author/dhtml/reference/properties/readystate.asp .
This link shows, that this property is only available since IE5.
So it does not seem to be appropriate for us. displayNotes() is
defined in the master page, and it is called from the user note
HTML page with the onload() you quoted above. That means to
me, that if a user notes file is *small*, then it loads quicker,
than the loading HTML page, and the error jumps in. But if the user
notes fil is big, than it won't load before the master page defines
displayNotes(). Or is page loading work in only one thread?
Goba