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
Cool, thanks a lot. I would have a go at it and let you know. Appreciate the time you had spent on this.
Cheers
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.
I dont think FireBug is the issue in my case, as it shows 'undefined' even in other boxes with no firebug on.
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.
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.
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??
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.
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
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.
acoder 16,027
Recognized Expert Moderator MVP
Did you have it as:
xmlObj.readySta te == "4" (string) or
xmlObj.readySta te == 4 (integer)?
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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()"
|
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"
|
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...
|
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
| |
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.
|
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(){
|
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...
|
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...
|
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>
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |