1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

in javascript ajax image loading

Discussion in 'JavaScript' started by srikanthever4u, Jan 18, 2010.

  1. #1
    Hello All,
    in java script how to use Ajax image loading processing..

    Cheers
     
    srikanthever4u, Jan 18, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    I think ajax is not important for it. It can be done by JavaScript.

    Example:

    
    <html>
    
    <head>
      <title>Loading image</title>
    </head>
    
    <body>
    
    <img id="loading_image" src="http://forums.digitalpoint.com/images/misc/dps_logo.gif">
    <div id="loading">Loading...</div>
    
    </body>
    
    <script>
        document.getElementById('loading_image').style.display = "none";
        document.getElementById('loading').style.display = "";
        document.getElementById('loading_image').onload = function(){
            document.getElementById('loading').style.display = "none";
            document.getElementById('loading_image').style.display = "";
        }
    </script>
    
    </html>
    
    Code (markup):
     
    s_ruben, Jan 18, 2010 IP