javascript equivalent of ASP preInit event

Posted by Pankaj Kumar on Stack Overflow See other posts from Stack Overflow or by Pankaj Kumar
Published on 2009-10-05T11:03:03Z Indexed on 2010/04/04 12:03 UTC
Read the original article Hit count: 273

Filed under:
|
|
|
|

Hi guys,

searching for this has yielded no resuts..

i have a middle page that has an iframe and all the pages open in that iframe...i have to implement a chat system just like in Google and so to ensure that the chat windows did not close whwn the page would postback i am opening all pages in iframe....

this is a social networking site and user can have themes which have background images per theme

now when i visit a friends profile the backgrounf image of the middle page should change...

i have this code to find parent of iframe and change background image

$(document).ready(function(){
     var theme=document.getElementById("ctl00_decideFooterH").value;
     var t= parent.document.getElementsByTagName("body");
            if(theme=='basicTheme'){          
           t[0].className="basic";
          }
          else if(theme=='Tranquility')
          {
            t[0].className="Tranquility";

          }
          else if(theme=='AbstractPink')
          {
            t[0].className="abstractPink";
          }
    });

and this code is the master page that all child pages that would open in iframe would access..the trouble is that there is a lag between the theme application on server side(which happens at PreInit) and the background image change which is done by this document.ready that gets executed after the iframe has loaded..

so essentially i need a javascript function that would either execute parallel to PreInit or some other logic....so guys plz help its urgent

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about themes