474,046 Members | 9,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox - 'undefined' error

20 New Member
I have a page with table layout which has an AJAX request sent on body onLoad event, during this time the table cells show static text like "Loading". The table cells are later updated with the AJAX response. So when I try to move out of the page once the AJAX request is sent by clicking on a link for exmple, the "Loading" changes to "undefined" . I read that innerHTML is not supported by firefox for table cells so i started using div inside the table cell yet no result. However IE and Opera seems to work fine. could anyone please tell me where am going wrong ?? Thanks a ton
May 7 '08
23 2875
pravinasp
20 New Member
Cool, thanks a lot. I would have a go at it and let you know. Appreciate the time you had spent on this.

Cheers
May 8 '08 #11
Plater
7,872 Recognized Expert Expert
I have noticed on FF a lot when using the FireBug addon that it shows various javascript functions as "undefined" when you attempt to navigate away from a page, that might have pending javascript code running.
May 8 '08 #12
pravinasp
20 New Member
I dont think FireBug is the issue in my case, as it shows 'undefined' even in other boxes with no firebug on.
May 8 '08 #13
acoder
16,027 Recognized Expert Moderator MVP
Yes, it seems it's only triggered if you leave the page.

I'm not sure what might be triggering it, but perhaps you need to abort the request onunload.
The XMLHttpRequest object has an abort() method which you can use or set the variable to null. Just make sure that the request hasn't already finished. If it has, then there's nothing to worry about anyway.
May 9 '08 #14
Plater
7,872 Recognized Expert Expert
Well I get the undefined error for other functions that have no relation to the xmlhttprequest stuff. They shouldn't even be being accessed, but firebug still likes to throw errors for it.
May 9 '08 #15
pravinasp
20 New Member
I tried nulling the xmlhttp object, but still remains the same. I dont really understand how the error gets triggered. Not all the table cells show undefined, only two columns does that. The other column which is also updated with the AJAX response goes blank instead of saying undefined. There are no differences between these columns though. I cant think of a reason why firefox would do it... any suggestions??
May 9 '08 #16
Plater
7,872 Recognized Expert Expert
If you try to call a method/function on an object that doesn't support it, you frequently are returned "undefined"
Like trying to use TOSTRING() vs toString() and such.
May 9 '08 #17
pravinasp
20 New Member
Problem sorted,

" xmlObj.readySta te == "4" || xmlObj.readySta te=="complete" "

This is the line that had the problem. The readyState receives only a numeric response and no string. So this was breaking the script here when i compare readyState to "Complete" and was returning an empty responseText all the time. So when i tried to split responseText and add it to the div elements the first element went null and the others were saying undefined.

Any explanation on why this would break in firefox alone would be appreciated.


Thanks for all your help guys

Cheers
May 12 '08 #18
Plater
7,872 Recognized Expert Expert
IE "doesn't care"?
Also, I notice that in IE, the ready state will be set to a winsock error code number when such events arrive (like host not found), whereas FF throws a javascript exception. So be sure to use try/catch statements.
May 12 '08 #19
acoder
16,027 Recognized Expert Moderator MVP
Did you have it as:
xmlObj.readySta te == "4" (string) or
xmlObj.readySta te == 4 (integer)?
May 12 '08 #20

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

Similar topics

2
4732
by: Johnny | last post by:
Searched on google for any info relating to this before posting here but found none. I set up a web service using nusoap on apache php 4.3.8 on windows with error_reporting = E_ALL and had that service set a cookie in the client browser as the first output. Works fine in IE6 and the service returns the state of the cookie in the client browser but in firefox 1.0 the exact same service gives a notice error about an undefined variable...
4
9317
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form action="MaintNotification.php?ReqID=5" method="post" name="frm5"> <tr align="left" bgcolor="#dddddd" class="text" onClick="submit()"
15
19919
by: Dan | last post by:
Hi. I've got the following line of code which works fine in IE ... line_1_numbers = document.getElementsByTagName ('table').rows (0).cells (0).innerText; But it Firefox, it barks saying: "Error: document.getElementsByTagName("table").rows is not a function"
5
3520
by: Martin Chen | last post by:
I have a frame set (as per MS FrontPage 2000). It has a contents and a main frame. The contents frame has a menu bar written with with javascript (in the context of a table). In IE6.1 everything works fine as it also does in firefox if I call the contents frame directly (i.e. outside of its frameset). However, if I call my main page (index.html) which invokes the frame set, the contents frame javascript menubar onmouseover function...
5
2993
by: Mark D Smith | last post by:
Hi anyone know what the java error is on this page? http://www.s-nta.org.uk/index.html Mark
1
2317
by: dasayu | last post by:
Hi, I have a custom object called gridWidget. I am consistantly getting an error in FireFox when I click on an href, which calls a function defined on the object. The generated link looks similar to: javascript:gridWidget.editColumn(3, 3, 'PDDSectionForm', 'pdd_link', ..) The above works fine in IE.
7
9645
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script language="JavaScript"> var cntlName; var eleTarget = document.getElementById('hiding'); function showOrHide(){
3
26777
by: jon | last post by:
Hello, I've had long standing code that runs in IE, that I'm testing with firefox unsuccessfully now. The problem seems to be that images that I dynamically create don't fire their onload event in firefox. The onload method I assign is never being called. Any ideas why firefox isn't calling this, or what I can do for a workaround? Below is approxiatemate code of what I'm doing...
9
3829
by: johnd126 | last post by:
I have a cgi program which outputs a fairly hefty amount of html/javascript for doing a complex slide show sorta thing in a variety of areas in the browser. I accomplish this by creating a series of iframes and populating each iframe which its own copy of the code and a list of items to display. It previously had it working tickety-boo with both IE 6 and Firefox. I've had to concentrate on adding new features to the IE side and am now...
7
5407
by: rwaller | last post by:
Works fine in IE, but not in Firefox? Code below, thank you in advance.... http://www.cnusd.k12.ca.us/roosevelt%2Dhs/Leaving_Site/leavingERHSpavelgcy.html <SCRIPT LANGUAGE=vbscript> function callMsgBox2(strMsg) callMsgBox2 = msgBox(strMsg,4,"Leaving ERHS") end function </SCRIPT>
0
10548
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
11604
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
12032
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11145
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...
0
10314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8701
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...
1
5421
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
2
4945
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3974
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.