Document.all.WebBrowser is empty or not an object

Source: Internet
Author: User

Project also want to use this function, found error, after testing, must add <object id= "WebBrowser" width=0 height=0 classid= "CLSID : 8856F961-340A-11D0-A96B-00C04FD705A2 ">
</object> this sentence is OK!!

------The following content is available online

In the page is not JS open to press Window.close (), there will be a prompt box, very annoying, now can not use, no prompt box directly close the window.
Try the following code:

<object id= "WebBrowser" width=0 height=0 classid= "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" >
</object>
<input type= "button" name= "button" value= "Close Window" onclick= "Document.all.WebBrowser.ExecWB (45,1)" >
Trying to change the parameters will give you some additional features:

WEBBROWSER.EXECWB (*) Open
WEBBROWSER.EXECWB (2,1) Close all IE windows now and open a new window
WEBBROWSER.EXECWB (4,1) Save Web page
WEBBROWSER.EXECWB (6,1) printing
WEBBROWSER.EXECWB (7,1) Print preview
WEBBROWSER.EXECWB (8,1) print Page Setup
WEBBROWSER.EXECWB (10,1) view page Properties
WEBBROWSER.EXECWB (15,1) seems to be withdrawn, pending confirmation.
WEBBROWSER.EXECWB (17,1) Select all
WEBBROWSER.EXECWB (22,1) Refresh
WEBBROWSER.EXECWB (45,1) Close the form without prompting

These are only valid for IE5.5 and above, I was tested under IE6, passed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.