1 balupton Jul 03, 2006 03:48
3 balupton Jul 03, 2006 04:01
Yeh, i've been fidling and deciding about wether to use endbody instead, but the only things that would go in endbody would be javascripts.
And it sure saves the repetitive <script .... for each plugin that needs it.
*Leaves to buy a six pack of cheap lager, you're killin me*
4 edb Jul 03, 2006 15:49
Perhaps I'm a bit confused, but why would you use a client-side script to trigger a server-side action? Isn't it much better to do all the server side stuff at the server? Either way, it'll fail when the visitor doesn't allow javascripts.
Skins that depend on javascript should carry a warning label.
5 blueyed Jul 03, 2006 18:58
What's bad with using the SkinBeginHtmlHead() event and outputting
<script type="text/javascript">
addEvent( document, "load", my_function, false|true );
</script>
there? This will add it to the document's onload events..
6 balupton Jul 03, 2006 19:26
I believe that waits for the whole page to load, not just the dom. So the javascript would be waiting for images to load as well, which could take a while...
7 balupton Jul 28, 2006 07:48
blueyed wrote:
What's bad with using the SkinBeginHtmlHead() event and outputting
<script type="text/javascript"> addEvent( document, "load", my_function, false|true ); </script>
there? This will add it to the document's onload events..
That does not work with firefox...
Although this does;
function addLoadEvent(func) {
// taken from; http://simon.incutio.com/archive/2004/05/26/addLoadEvent
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(init);
*puts overpriced beer down* wouldn't it make more sense to have :-
The plugin could write the <script></script> tags, and it would give a smidge more flexability.
*wanders off to find EdB's secret stash of JB*
¥