Calling object more than once
<p>Hello I have code which replaces <code>document.write</code>, makes a buffer and than pushes buffer into the document:</p>

<pre><code>  var lazyLoad = {

    url: '',
    block: '',
    buffer: '',

    init: function(url,block){
        that = this
        that.url = url;
        that.block = block;

        console.info(this.block)
        console.log(this.url)

        window.d = document
        window.onload = function(){
            that.work()
        }   
    },

    work: function(){
        that = this
        d.write = d.writeln = function(s){ 
                                    that.buffer += s
                                }
        d.open = d.close = function(){}
        s = d.createElement('script');       
        s.setAttribute('type','text/javascript');
        s.setAttribute('src',that.url);
        d.getElementById(that.block).appendChild(s)
        s.onload = function () {
            window.setTimeout(function() {

                console.warn(that.block + ' ' +that.buffer)
                d.getElementById(that.block).innerHTML += that.buffer;
                that.buffer = '';
            }, 0);
       }
    }
}
</code></pre>

<p>If I init it once:</p>

<pre><code>lazyLoad.init(
        'http://test.com/test.js',              
         div1
)
</code></pre>

<p>But if I call it again with other parameters:</p>

<pre><code>lazyLoad.init(
        'http://test2.com/test.js',             
         div2
)
</code></pre>

<p>First init wont work. <code>window.buffer</code> will be empty. Where is my mistake? </p>

<p>P.S. another problem: I tried to replace <code>window.onload</code> with jQuery method <code>$(window).load()</code> but it fires twice. How can I fix it?</p>
