If you don't want to put a script after the div it won't get any
faster then DOM ready.

You could although poll for that element. Say it had an id of
'asap' (untested):

(function() {
    var f = function() {
        var div = document.getElementById('asap');
        if (div) {
            // alter content here...
        } else {
            setTimeout(f, 30);
        }
    };
    f();
})();


--Klaus


On 5 Nov., 16:30, the_woodsman <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to change the content of a div asap.
>
> I know about document.ready, but if possible I'd rather do this
> earlier. I'd also rather do it as an event instead of loading a script
> file after the div appears in the page.
>
> I tried the load() event, but this didn't seem to fire at all.
>
> Anyone got any tips on this?

Reply via email to