473,499 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

function is undefined

3 New Member
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
2 1701
pankajit09
296 Contributor
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
5,390 Recognized Expert Moderator Expert
... 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

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

Similar topics

7
36547
by: JT | last post by:
how can i declare a function that will accept an optional parameter? something like: function newFunc(strValue1, strValue2) --where strValue2 is optional. thanks much.
7
1744
by: shahehe | last post by:
The following code seems fine to me but when I tried to compile it using g++ test.C, I got lots of errors, why? #include <iostream> static const int MAX_STACK = 100; class Stack
18
2070
by: Razvan | last post by:
Hi! What is the purpose of such a function ? int function(void)
6
2252
by: lovecreatesbeauty | last post by:
I ever missed a `return' statement when write a function `int HighDigit(Num)' to get the highest digit of an integer. But even if the `return' statement is ignored the function still can obtain...
17
2184
by: Razzel | last post by:
I created this as a test: #include <time.h> main(){ printf(X1: %s\n", putim()); printf(X2: %s\n", putim()); } putim() { time_t t; time(&t); return(ctime(&t));
1
1431
by: CES | last post by:
All, I have absolutely no clue as to what the difference is between these two snippets but the on that is hard coded works and the other doesn't. I know it's something incredible stupid that I...
89
5947
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
11
2709
by: Felix Kater | last post by:
Hi, I can compile and run this code (see below) which twice calls the function f, first with too less, second with too much arguments. But is it legal and free of memory leaks and other...
8
2809
by: optimistx | last post by:
In excellent YAHOO user interface programs I see often extra parenthesis like this (foo=function(){ alert('I am foo'); })(); instead of bar=function(){
17
4076
by: venkat | last post by:
Hi, I have written a program void main() { printf("%d %d\n", sizeof main, sizeof(main())); } in this program the output is 1 and 4,
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.