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

document.write question

 
Harsha Jay
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a need to show the string output (return from javascript function )to presentation JSP. If I use document.write() the result is displayed in the entire page, How can I show the JS return string in a <td></td> only or a <li></li> element only. Is this possible?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not use document.write after the page load. The best bet is to give the location you want the data to appear an id. Reference than id and set the DOM [createElement/createTextNode] or innerHTML with the new data.






Eric
 
Harsha Jay
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
great Thanks, I am giving it a shot right now!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic