Init Object with different parameters
<p>I have an object and I call it many times in my page, but with different parameters.</p>

<pre><code>var lazyLoad = (function () {

    var CONFIG = {
        block: '',
        url: ''
    }

    function work(){            
        window.d = document
        var buffer = ''
        d.write = d.writeln = function(s){ buffer += s }
        d.open = d.close = function(){}
        s = d.createElement('script') 
        s.setAttribute('type','text/javascript')
        s.setAttribute('src',CONFIG.url)
        d.getElementById(CONFIG.block).appendChild(s)
        s.onload = function () {
            window.setTimeout(function() {
                console.warn(CONFIG.block + ' ' + buffer)
                d.getElementById(CONFIG.block).innerHTML += buffer
                buffer = ''
            }, 0)
       }
    }

    return {
            init: function (options) {
                $.extend(CONFIG, options);

                random = $('#'+CONFIG.block).attr('rel')
                id = $('#'+CONFIG.block).attr('id').replace(random,'')
                id = id.replace('DIV','')
                size = id.split('X')
                ele_width = size[0] || CONFIG.width
                ele_height = size[1] || CONFIG.height

                $('#'+CONFIG.block).css({
                                            'width':ele_width+'px',
                                            'height':ele_height+'px',
                                            'background':'url(/static/i/ajax-loading-black.gif) no-repeat center center'
                                        })

                console.log(CONFIG.block)
                $(window).load(function(){

                        work()

                })
            }

    }

})();
</code></pre>

<p>I call it like this:</p>

<pre><code>lazyLoad.init({
            url: 'http://example.com/test1.js',
            block: DIVID1
        })
</code></pre>

<p>Than </p>

<pre><code>lazyLoad.init({
            url: 'http://test.com/test2.js',
            block: DIVID2
        })
</code></pre>

<p>And than:</p>

<pre><code>lazyLoad.init({
            url: 'http://testdomain.com/test3.js',
            block: DIVID3
        })
</code></pre>

<p>After loading the document I see that each <code>div</code> has width and height, which is applied with this script, but <code>buffer</code> was inserted only in last <code>div</code>. </p>
