Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

object required in java script error

 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i am using ajax and servlet i got error object required can any body tell what is the problem





 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your XML looks invalid to me
You are not using documentElement with responseXML
You need to debug and see what you are actually referencing.

Eric
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting error in this line object required
document.getElementById.innerHTML=xmlDoc.getElementsByTagName("memberid")[0].childNodes[0].nodeValue;

my xml format is like this

<bookissue>
<memberid>m0001</memberid>
<bookname>c programming</bookname>
<authorname>balagurusamy</authorname>
<doi>12-oct-2009</doi>
<dd>22-oct-2009</doi>
</bookissue>

is there syntax problem in this line? can anybody tell how to get these values?




 
Srikkanth Mohanasundaram
Ranch Hand
Posts: 242
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.getElementById.innerHTML


I hope this is a typo. You have to pass the element id to this method
The XML is also invalid
<dd>22-oct-2009</doi>



Thanks,
Srikkanth
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vijayakumar durai wrote:i am getting error in this line object required
document.getElementById.innerHTML=xmlDoc.getElementsByTagName("memberid")[0].childNodes[0].nodeValue;

my xml format is like this

<bookissue>
<memberid>m0001</memberid>
<bookname>c programming</bookname>
<authorname>balagurusamy</authorname>
<doi>12-oct-2009</doi>
<dd>22-oct-2009</doi>
</bookissue>

is there syntax problem in this line? can anybody tell how to get these values?






You have a typo in your xml there with the dd. You XML it is invalid. Read #4 here: http://radio.javaranch.com/pascarello/2006/09/12/1158096122600.html

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic