Open the file from IFRAME and check whether IFRAME exists...

Source: Internet
Author: User

A few days ago, I learned this together in the group...
If you only want to check whether the page exists or not, you can directly set the target to use the pseudo protocol to solve the problem...
However, if IFRAME [name] is used, it will involve the onload issue... so it will be a lot of trouble ....
The following only adds a delay... there is no "real" issue of onload processing .... in fact, we can loop through windows. open to solve the problem, but it's just a bit lazy... ^

 

<A href = "javascript: void (0);" onclick = "openc ('HTTP: // www.google.cn/', 'cs', this)"> Google </a>
<SCRIPT type = "text/JavaScript">
Window. openc = function (href, target, e ){
Try {
Window. Open ('javascript: If (! Document. Body) {opener. openc. isnull = true; opener. Open ("C. asp"); close () ;}', target | '');
Window. setTimeout (function (){
If (window. openc. isnull ){
Delete window. openc. isnull;
Window. setTimeout (function (){
E. fireevent ('onclick ');
},500 );
} Else {
Window. Open (href, target );
}
},100 );
} Catch (exp ){
Alert (exp. Message );
}
};
</SCRIPT>

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.