Use JQUERY to get the IFRAME load complete event _jquery

Source: Internet
Author: User


1. The Web page in the IFRAME loaded after the completion of the hope to do some work. For example, the content of the IFRAME before the change in the display of "loading", after the completion of the load, the display changed to "load complete." So what to do with it.

2.

3. In jquery, the IFRAME load completion event is load rather than ready

4.

5.

6.

7. <meta http-equiv= "ContentType" content= "Text/html;charset=utf-8" >

8. <script src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" ></script>

9. <script>

$ (function () {

$ ("#phone"). Change (function () {

$ ("#message"). Text ("Loading ...");

$ ("#theone"). attr ("src", $ (this). Val ());

14.});

15.

$ ("#theone"). Load (function () {

$ ("#message"). Text ("");

18.});

19.});

</script>

<body>

<select id= "Phone" >

<option value= "http://www.google.com.hk/" >any one</option>

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153427683.jpg" >HTC dream</option>

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153454306.jpg" >HTC magic</option>

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153453524.jpg" >HTC hero</option>

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153464400.jpg" >HTC hattoo</option >

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153483133.jpg" >nexus one</option>

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153485258.jpg" >HTC legend</option >

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153510582.jpg" >HTC desire</option >

<option value= "Http://www.streamcave.com/upload/2010/8/201008251153532800.jpg" >motorola milestone</ Option>

</select>

<span id= "message" style= "Color:green" ></span>

<iframe id= "Theone" src= "width=" "height=" ></iframe>

Panax </body>

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.