Wait frame load


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Wait frame load

  1. #1
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    45

    Wait frame load

    Hi

    I need to make a function that wait until a frame load.

    function aaa(pg)
    {
    parent.frame.location.href=pg;
    WaitFrameLoad; -> Here I need the code
    alert("Frame loaded!");
    }


    I need a script written in JavaScript or in VBScript.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    45

    Lightbulb

    I found the solution for this problem.

    All I had to do is:
    var pgTmp;
    function Change(pg) {
    pgTmp=parent.frame.location.href;
    parent.frame.location.href=pg;
    CheckLoaded(pg);
    }

    function CheckLoaded(pg) {
    if (parent.frame.location.href == pgTmp) {
    setTimeout('CheckLoaded(pg)',20);
    return 0;
    }
    alert("Page to load: " + pg + "; Page loaded: " + arent.frame.location.href);
    }
    This code works to check if a 404 error occured, you just remplace the alert by:
    if (parent.frame.location.href != pg) {...}

Similar Threads

  1. Replies: 1
    Last Post: 05-15-2003, 06:43 PM
  2. Replies: 1
    Last Post: 10-23-2002, 09:52 PM
  3. Another Frame Question
    By Micah Nasarow in forum Web
    Replies: 1
    Last Post: 08-24-2001, 08:31 PM
  4. Replies: 0
    Last Post: 03-07-2001, 03:46 PM
  5. Controlling Menu from another frame
    By Moose in forum Java
    Replies: 0
    Last Post: 06-06-2000, 06:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center