load a page in div tag with preloading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mirzaei1
    New Member
    • Oct 2011
    • 4

    load a page in div tag with preloading

    Hi my friends
    I have a dive tag in my page,what I want is that when user click a link a html or php page loads in this div and during loading of the html or php file in the div a preloading shows.

    thanks to help me.
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    what do you have done so far?

    Comment

    • mirzaei1
      New Member
      • Oct 2011
      • 4

      #3
      I have made my preloader with css and javascript but because onload event dosnt support in div tag when the preloader shows with clicking the link it dosnt disapear after loading page into div,I have also used some codes but when the images are downloading(not after they downloaded) the preloading disapears.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5388

        #4
        things start to mix up - what exactly is to be loaded? basically you might use an AJAX-call to retrieve the html-code that should be placed in a div but if that html-code contains images then they are loaded through the src-attrib (new and own requests) so that you might need a n img-preloading mechanism too

        Comment

        • mirzaei1
          New Member
          • Oct 2011
          • 4

          #5
          what should be loaded is a complet html file including images.

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5388

            #6
            that invalidates your html? a div shouldn't contain a 'normal' html-file.

            anyway ... in case you want to really controll all loading with such a mask you have to preload the images and the page and find a way to sync that so that you know when to rmove the mask. it is not a trivial thing to do so you should need to know if it's worth the efforts

            Comment

            • mirzaei1
              New Member
              • Oct 2011
              • 4

              #7
              I need an ajax code in order to callback the complete load of all images in page?

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5388

                #8
                no - you cannot load images via an XMLHttpRequest - to ensure you have all imgages loaded then you need an image-preloader like this

                Comment

                Working...