HTML readyState Property IFrame onreadystatechange Event

Source: Internet
Author: User

-----------readyState---------------Definition and usage

The ReadyState property returns the status of the current document (Loading ... )。

The property returns the following values:

    • Uninitialized-loading not yet started
    • Loading-GTA5-in
    • Interactive-loaded, the document and the user can start interacting
    • Complete-Loading completed
Grammar Document.readystate

This property is read-only and returns the following possible values:

The 0-uninitialized:xml object is generated, but no files are loaded.
1-loading: The loader is in progress, but the file has not started parsing.
2-loaded: Some of the files have been loaded and parsed, but the object model has not yet taken effect.
3-interactive: Valid only for partially loaded files, in which case the object model is valid but read-only.
4-completed: The file has been fully loaded, representing a successful load.

-----------onreadystatechange---------------First:
IFRAME onreadystatechange events only for ie5.5 or later
Frame does not support onreadystatechange events

For IFRAME
<iframe name= "Ifm_test" src= "http://www.google.cn" onreadystatechange= "Fnstartinit ()" ></iframe>

or write in JS:
<iframe name= "Ifm_test" ></iframe>
<script language= "JavaScript" >
function LoadFile ()
{
Document.frames ("Ifm_test"). location.href= "http://www.google.cn";
Document.frames ("Ifm_test"). Onreadystatechange=fnstartinit ();
}
function Fnstartinit ()
{
if (Document.frames ("Ifm_test"). readystate== "complete")
{
Alert ("The framework file is loaded! ");
}
}

For frame:
<frameset cols= "*,*" >
<frame name= "Ifm_test" src= "http://www.google.cn"/>
<frame name= "Ifm_test1" src= "http://www.baidu.cn"/>
</frameset>

can only write in JS:
<script language= "JavaScript" >
Document.onreadystatechange = ready;
function Ready ()
{
if (document.readystate = = "complete")
{
Alert ("The framework file is loaded! ");
}
}
</script>

HTML readyState Property iframe onreadystatechange event

Related Article

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.