Click here to Skip to main content
16,010,650 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: get all elements under a mouse drag selection Pin
Jayapal Chandran4-Apr-10 6:43
Jayapal Chandran4-Apr-10 6:43 
GeneralRe: get all elements under a mouse drag selection Pin
Not Active4-Apr-10 7:50
mentorNot Active4-Apr-10 7:50 
GeneralRe: get all elements under a mouse drag selection Pin
Jayapal Chandran5-Apr-10 7:09
Jayapal Chandran5-Apr-10 7:09 
Questionsendemail to those whose email id is in text file Pin
rajivkadam4201-Apr-10 19:42
rajivkadam4201-Apr-10 19:42 
AnswerRe: sendemail to those whose email id is in text file - not an expected reply Pin
Jayapal Chandran4-Apr-10 6:48
Jayapal Chandran4-Apr-10 6:48 
AnswerRe: sendemail to those whose email id is in text file Pin
raghvendrapanda5-Apr-10 3:20
raghvendrapanda5-Apr-10 3:20 
QuestionWeb Services -- start up notifications Pin
RedZenBird1-Apr-10 14:22
RedZenBird1-Apr-10 14:22 
Questionajax, xml results and ie error "object required" Pin
cjoki1-Apr-10 9:12
cjoki1-Apr-10 9:12 
Hello all,

This is more of a posting of my findings. I traced the issue I had with an ajax script error. Since I found little information on the web on a fix for it, I wanted to make this post.

The Issue:
I have an ajax call to a script that returns contact information stored in a database. The xml result looks like this
<rs>
  <coname>A Company</coname>
  <addr>123 main st.</addr>
  <city></city>
  <state></state>
  <zip>77001</zip>
</rs>


When the returned information include fields that are empty ie will throw an error "object required" when you try to access the value like...

document.getElementById("city").value = xmlDoc.getElementsByTagName("city")[0].childNodes[0].nodeValue;

...this is the source of the ie error, firefox does not generate an error.

Testing for empty string or null has no effect.

To work around it you can test for an empty sring in the result from the database query and either use a character string to test for in your callback function or leave the value out of the xml and test for undefined. Like..

<rs>
  <coname>A Company</coname>
  <addr>123 main st.</addr>
  <city>-1</city>
  <state>-1</state>
  <zip>77001</zip>
</rs>


or

<rs>
  <coname>A Company</coname>
  <addr>123 main st.</addr>
  <zip>77001</zip>
</rs>


Anyone else have ideas on this issue, I would like to hear them.

All the Best!
AnswerRe: ajax, xml results and ie error "object required" [modified] Pin
daveyerwin1-Apr-10 12:44
daveyerwin1-Apr-10 12:44 
GeneralRe: ajax, xml results and ie error "object required" Pin
cjoki6-Apr-10 9:00
cjoki6-Apr-10 9:00 
QuestionFrom C++ to Web - which way to go? Pin
Caslen1-Apr-10 6:10
Caslen1-Apr-10 6:10 
AnswerRe: From C++ to Web - which way to go? Pin
Not Active1-Apr-10 6:43
mentorNot Active1-Apr-10 6:43 
GeneralRe: From C++ to Web - which way to go? Pin
Caslen1-Apr-10 8:29
Caslen1-Apr-10 8:29 
GeneralRe: From C++ to Web - which way to go? Pin
Not Active1-Apr-10 9:07
mentorNot Active1-Apr-10 9:07 
GeneralRe: From C++ to Web - which way to go? Pin
Caslen1-Apr-10 9:18
Caslen1-Apr-10 9:18 
GeneralRe: From C++ to Web - which way to go? Pin
cjoki1-Apr-10 9:30
cjoki1-Apr-10 9:30 
AnswerRe: From C++ to Web - which way to go? Pin
daveyerwin1-Apr-10 7:19
daveyerwin1-Apr-10 7:19 
GeneralRe: From C++ to Web - which way to go? Pin
Caslen1-Apr-10 8:23
Caslen1-Apr-10 8:23 
GeneralRe: From C++ to Web - which way to go? Pin
Jayapal Chandran4-Apr-10 7:06
Jayapal Chandran4-Apr-10 7:06 
AnswerRe: From C++ to Web - which way to go? Pin
Caslen6-Apr-10 23:00
Caslen6-Apr-10 23:00 
NewsThree-day India Training on Building RIAs with Ajax, jQuery and Java by Best-selling Author Marty Hall Pin
Rajesh557531-Mar-10 23:16
Rajesh557531-Mar-10 23:16 
GeneralRe: Three-day India Training on Building RIAs with Ajax, jQuery and Java by Best-selling Author Marty Hall Pin
R. Giskard Reventlov31-Mar-10 23:38
R. Giskard Reventlov31-Mar-10 23:38 
QuestionJavascript conflicts Pin
vafo31-Mar-10 2:10
vafo31-Mar-10 2:10 
AnswerRe: Javascript conflicts Pin
daveyerwin31-Mar-10 3:02
daveyerwin31-Mar-10 3:02 
AnswerRe: Javascript conflicts Pin
T M Gray31-Mar-10 11:43
T M Gray31-Mar-10 11:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.