Need JavaScript to delay loading a div block

Discussion in 'HTML & Website Design' started by reyad010, Dec 1, 2011.

  1. #1
    Hi,
    Can anyone tell me how may I delay loading a div block (ad scrip inside it) for sometimes to increase page's main content loading speed? Let me give you an example code.

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    #myDiv {
    /* 
    
    ---------------
    
    Code Goes Here
    
    ---------------
    
    */
    }
    
    </style>
    
    </head>
    
    
    <body>
    
    <div id="myDiv"><script src="/ads.js"/></div>
    
    
    </body>
    </html>
    
    Code (markup):
    In this HTML document, I want to delay Loading myDiv block so that other div's can load first.

    Is there any way to do so?
     
    reyad010, Dec 1, 2011 IP