Synchronous XMLHttpRequest warning and [removed]

前端 未结 7 1904
猫巷女王i
猫巷女王i 2020-11-27 16:56

I\'m getting a warning message:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user\'s expe

相关标签:
7条回答
  • 2020-11-27 17:35

    if you just need to load script dont do as bellow

    $(document.body).html('<script type="text/javascript" src="/json.js" async="async"><\/script>');
    

    Try this

    var scriptEl = document.createElement('SCRIPT');
        scriptEl.src = "/module/script/form?_t="+(new Date()).getTime();
        //$('#holder').append(scriptEl) // <--- create warning
        document.body.appendChild(scriptEl);
    
    0 讨论(0)
提交回复
热议问题