如何从从<head>内的<script>标签加载的脚本请求中获取jqXHR对象

How to get jqXHR object from script request that is loaded from <script> tag inside <head>

本文关键字:脚本 请求 jqXHR 对象 获取 script head 内的 标签 加载      更新时间:2024-02-12

jQuery的getScript((在加载脚本时返回jqXHR对象。当脚本从放置在 head 标签内的脚本标签加载时,有没有办法获取 jqXHR 对象?

function makeScript(url){    
    script = document.createElement("script");
    script.src = url;
    //when this line is executed the script will be loaded by the browser
    //how to get the jqxhr object
    document.head.appendChild(script); 
}

不,因为没有。浏览器以本机方式处理所有内容。

相关文章: