aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to detect that browser is going to issue a write command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to detect that browser is going to issue a write command" Watch "how to detect that browser is going to issue a write command" New topic
Author

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

lily ling
Greenhorn

Joined: Dec 03, 2001
Posts: 25
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
document.write happensa s the page is being rendered? I am not sure what you are trying to do.

Eric
lily ling
Greenhorn

Joined: Dec 03, 2001
Posts: 25
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
unless you can write an if statement around it, then no....
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
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

Joined: Dec 03, 2001
Posts: 25
thank you very much, Eric.

Lily
lily ling
Greenhorn

Joined: Dec 03, 2001
Posts: 25
And thanks to Yuriy. I will try that out.

Lily
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to detect that browser is going to issue a write command