By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

function is undefined

P: 3
I built a javascript error reporter into files that I posted to live sites several weeks ago. I've received a few reports in the error log that show that functions defined in a file loaded via the page headers are showing up as undefined. The pages are viewed many times without these troubles occurring, but they sometimes do. It has happened with IE6 and Firefox 1.5 so I don't think the problem is browser specific. I understood that functions loaded through the header would be available for scripts in the body to use, so I do not think that it could be a timing problem or race condition, but maybe I'm wrong on that???

Has anyone else observed these types of errors? Any ideas as to the cause and possible solutions?
Sep 17 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 296
I built a javascript error reporter into files that I posted to live sites several weeks ago. I've received a few reports in the error log that show that functions defined in a file loaded via the page headers are showing up as undefined. The pages are viewed many times without these troubles occurring, but they sometimes do. It has happened with IE6 and Firefox 1.5 so I don't think the problem is browser specific. I understood that functions loaded through the header would be available for scripts in the body to use, so I do not think that it could be a timing problem or race condition, but maybe I'm wrong on that???

Has anyone else observed these types of errors? Any ideas as to the cause and possible solutions?

yes I have observed.

Whats the solution ?
May 27 '07 #2

gits
Expert Mod 5K+
P: 5,343
... do you use iframes or frames that refers functions in other frames through parent or whatever? until loading of html resources always is async there may be problems with that when using different onload events that rely on existence of parents or other frame-sources ... in that case you should ensure that only one (probably the top-frame) is loaded, and when it is ready ... then load the next pages that require code from here. ...

but this is only an idea until i don't know your application structure ... the above things are common problems ... and may be they are yours too?

kind regards ...
May 27 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.