javascript匿名函数有回调函数吗?

时间:2016-08-23 13:10:19

标签: javascript jquery

//将此添加到" OnDomLoad"事件

<script type="text/javascript"> 

(function(win,doc){
    var scriptElement, scrSrc;
    if (typeof (win.ClickTaleCreateDOMElement) != "function")
    {
        win.ClickTaleCreateDOMElement = function(tagName)
        {
            if (doc.createElementNS)
            {
                return doc.createElementNS('http://www.w3.org/1999/xhtml', tagName);
            }
            return doc.createElement(tagName);
        }
    }

    win.WRInitTime=(new Date()).getTime();

    scriptElement = ClickTaleCreateDOMElement('script');

    scriptElement.type = "text/javascript";

    scrSrc = doc.location.protocol=='https:'? 'https://cdnssl.clicktale.net/':  'http://cdn.clicktale.net/';
    scrSrc += 'www16/ptc/65823b2d-e976-415b-8417-8db9c9c11650.js';
    scriptElement.src = scrSrc;
    doc.getElementsByTagName('body')[0].appendChild(scriptElement);
})(window,document);

</script>

Javascript代码块,有回调函数吗?我可以把这行代码放在$(window).on(&#39; load&#39;,function(){}?

感谢

0 个答案:

没有答案