Preloading page...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thew
    New Member
    • Aug 2010
    • 69

    Preloading page...

    I had like this idea:

    Code:
    <div id="bezig">Preloading...</div>
    <div id="pagina" style="display:none;">
    <!-- some content-->
    </div>
    And when the page is fully loaded:

    Code:
    <div id="bezig" style="display:none;">Preloading...</div>
    <div id="pagina">
    <!-- some content-->
    </div>
    But how can i do this in Javascript / AJAX / Whatever?
    Last edited by Dormilich; Aug 21 '10, 08:18 AM. Reason: Please use [code] tags when posting code
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    basically you might start an ajax-call onload of the page and in its success-callback you could add the content and switch the style properties. what do you exactly want to know - except of that basic idea?

    Comment

    • Thew
      New Member
      • Aug 2010
      • 69

      #3
      I just want to know how to switch those functions, if the page is fully loaded.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        you would just need to retrieve the node's reference and set the style display property like this:
        Code:
        var node = document.getElementById('bezig')
        node.style.display = 'block';
        ... for example.

        Comment

        • Thew
          New Member
          • Aug 2010
          • 69

          #5
          Thanks, i made it working!

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            glad to hear that :) - just post back to the forum in case you have more questions ...

            kind regards

            Comment

            Working...