473,903 Members | 3,433 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 1708
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
36611
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
1782
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
2118
by: Razvan | last post by:
Hi! What is the purpose of such a function ? int function(void)
6
2282
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 an `correct' return value when the argument `Num' is larger than or equal to the Macro `NUM_SYS'. If the argument is less than the Macro, the function without a `return' get an undefined value. I've made a test on Ms Windows 2000 and VC 6.
17
2220
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
1446
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 should know but I just cant see it. //This works if it's hard coded: function setTimer(id,status){ if(status=="start"){ txt = new timer('txt',id); txt.startTimer(); }else if(typeof txt == "object"){
89
6103
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 used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
11
2749
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 problems? Of course, I presume that inside f I don't access i in case it was called via g. int f(int i){ /* ... */ return 0; }
8
2833
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
4119
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
10007
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11297
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10504
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7215
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5899
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4734
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3329
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.