00354: add onload"..." to <body>

Summary: add onload"..." to <body>
Created: 2005-03-04 05:37
Status: Closed
Category:
From: Klonk
Assigned:
Priority: 2
Version: 2.0beta24
OS:

Description: I want to create a cookbook recipe which uses Javascript. But for correct working a javascript function has to be called at BODY-onload.

So my question: Of course I could put the "onload" directly in the TMPL file, but I want to avoid that, so the recipe could be used with every skin.

How can I achieve this?

(Or at least in which variable do I have to replace the <body> with e.g. <body onload="..."> to get it in the output??


Does it have to go in the <body> tag? As long as the script is in the document output after the elements it needs to process (e.g., at the end), it can usually be made to work. For example, this is how we're able to place the input focus in the password prompt box without modifying the <body> tag.

Short of that, there's not yet a good skin-invariant way to manipulate <body>. Sorry about that. If you come up with one, let me know. :-) --Pm


Could use a different approach. See Cookbook/TreeMenu if you're interested. But as soon I find a good way I'll tell you. Klonk