/    Sign up×
Community /Pin to ProfileBookmark

Want to show Page Loading Status

Hello All,

Can any one help me. My webcraft pages has 2 frames one for menu and another to load the cooresponding page selected in the menu. When clicking a link in the menu some page are taking long time to load in the right frame. So i wud like to show page is loading message till the page is loaded in the frame. I tried with some methods but its not working. Am not sure whats going wrong.

  • 1. Every time your page loads a “init()” function will load.
  • <body onLoad=”init()”>

  • 2. Define a div named “loading” right after <body> section.
  • <div id=”loading” style=”position:absolute; width:100%; text-align:center; top:300px;”><img src=”loading.gif” border=0></div>
    The loading.gif image should be an animated gif that suggests that the page is still loading.

  • 3.

    Place this javascript code right after you define the div.

    <script> var ld=(document.all); var ns4=document.layers; var ns6=document.getElementById&&!document.all; var ie4=document.all; if (ns4) ld=document.loading; else if (ns6) ld=document.getElementById(“loading”).style; else if (ie4) ld=document.all.loading.style; function init() { if(ns4){ld.visibility=”hidden”;} else if (ns6||ie4) ld.display=”none”; } </script>

    I used the above method also but not working. Is it because am loading it in a Frame? If so what i have to do to show the message.

  • Thanks
    Shella?

    to post a comment
    JavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @zachalJul 25.2010 — try putting the javascript within <head> and </head> sections that is what Usually works?
    ×

    Success!

    Help @Shella spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...