Saturday, April 24, 2010

What event does IE fire when it loads a web page?

Is there a standard event that IE triggers across all web pages for either when the page begins to load or finishes loading? I am trying to attach some logic to these events but am finding that different events are fired by different webpages. =(



What event does IE fire when it loads a web page?windows mail





Well, your best bet to be able to execute c++ on the client, will be to look into ActiveX components (which you call via javascript or vbscript), the event that fires up on browser load you can attach like this:



%26lt;script%26gt;



window.onload = function()



{



// Do something



}



%26lt;/script%26gt;



The issue you will have with executing assemblies is obviously security, the moment the code wants to fire the user will get a warning.



What event does IE fire when it loads a web page?microsoft maps internet explorer



Depends on what scripting/programming language you're using.



For JavaScript you can call a function by putting onload="functionname(params)" inside the body tag



or for ASP.NET, in the behind code there is a PageLoad() function.



These are the ones I used, but I assume other languages (like PERL, PHP, AJAX...) have others.
These HTML objects have onload events:



APPLET, BODY, EMBED, FRAME, FRAMESET, IFRAME, IMG, LINK, SCRIPT, window



To use them use code something like this.



%26lt;body onload="DoPageLoadEvents();"%26gt;



....... body goes here -----



%26lt;/body%26gt;



This will call the javascript function called DoPageLoadEvents(); (An example is defined below)



%26lt;script language="javascript"%26gt;



%26lt;!--



function DoPageLoadEvents()



{



alert("The page has finished loading")



// place youe event code here and delete the line above.



}

No comments:

Post a Comment

 
mortgage loan