This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript document object writes in a new page?

 
pawan chopra
Ranch Hand
Posts: 415
jQuery Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this code when I am clicking on the button it writes hello but it removes button from the html page. Can any body tell me the reason and how to avoid this?

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not use document.write after the page loads. It replaces he content of the page when you do that.

If you want to add text to the page after it loads, you need to use innerHTML or appendChild.

Eric
 
pawan chopra
Ranch Hand
Posts: 415
jQuery Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot innerHTML worked for me! One more thing can you please guide me while in waiting stage how can i show a moving circle(as shown in attachment) using javascript. I hope this is possible using javascript.
circle.jpg
moving circle
[Thumbnail for circle.jpg]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Easy. Creating an animated GIF for your "moving circle", place it where you want it to show up, and hide it using the CSS display property.

When you want it to show up, use JavaScript to modify the CSS to make it show up.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.ajaxload.info/

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic