I had problems using the "Window.onload" in JavaScript, to add more
than one function, so they could all be executed once the page load.
Looking at the SWFObject, I noticed that get a solution to these
problems, which can add various functions to be executed once the page
is loaded.
I found interesting, and more at the same time, find that some older
browsers (Netscape 4, IE 5 ...), not accept very well this solution.
So I thought to create a method that can accept add various functions
to be executed once the page load. And yet, I thought in a form that
could place an order for implementation of certain functions.
Code for the method that has worked and created in current and older
browsers:
<!-- CODE JAVASCRIPT -->
function carOK(){};
carOK.prototype.funcoes = function(){
// here, several commands and functions to be executed first
someFunctions;
someCommands;
}
var mib=carOK.prototype.funcoes;
win.onload = function(){
var carr = new carOK();
for(var car in carr){
if(eval("typeof(carr."+car+")") == "function"){
eval("carr."+car+"();");
}
}
for(var car in carr.funcoes){
if(eval("typeof(carr.funcoes."+car+")") == "function"){
eval("carr.funcoes."+car+"();");
}
}
}
<!-- CODE JAVASCRIPT -->
And when I call I call a function like this:
<!-- CODE JAVASCRIPT -->
mib.second = second function;
mib.third = third function;
mib. fourth = fourth function;
//and will continue ...
<!-- CODE JAVASCRIPT -->
Once the page loads, the first functions that are implemented are
those which are within:
<!-- CODE JAVASCRIPT -->
carOK.prototype.funcoes = function(){
// here, several commands and functions to be executed first
someFunctions;
someCommands;
}
<!-- CODE JAVASCRIPT -->
Then, go running in order:
mib.second ... mib.third ... mib. fourth ...
What you think of the idea?
Ass: DJ Mib
Note: Translated by GOOGLE!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---