aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes document.write question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "document.write question" Watch "document.write question" New topic
Author

document.write question

Harsha Jay
Ranch Hand

Joined: Jul 23, 2001
Posts: 177
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jul 23, 2001
Posts: 177
great Thanks, I am giving it a shot right now!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: document.write question
 
Similar Threads
Newbie problem with XSLT
Internationalization login thru to...
Javascript Menu display on mouseover
Need help with Drop Down list
CSS navigation Menu