File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to detect that browser is going to issue a write command

 
lily ling
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, there

I know we can use document.write() to print any contents on page but how to know that browser is going to use this command before/while it starts to do printing. Is there any way to detect that what command browser is going to execute ?

Thank you very much, any advice is highly appreciated.

Lily
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.write happensa s the page is being rendered? I am not sure what you are trying to do.

Eric
 
lily ling
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know if we can capture document.write() command that browser is going to execute to print the page so I can add some other logic.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unless you can write an if statement around it, then no....
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what are you trying todo...
Have you tried something like:

So, whenever the page will try to call document.write (after your function definition, so put it at the begining of the page), your code will be called.
 
lily ling
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much, Eric.

Lily
 
lily ling
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And thanks to Yuriy. I will try that out.

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