我意识到我在这里有点晚了(5 年左右),但我认为有一个比公认的更好的答案如下:
$("#addComment").click(function() {
    if(typeof TinyMCE === "undefined") {
        $.ajax({
            url: "tinymce.js",
            dataType: "script",
            cache: true,
            success: function() {
                TinyMCE.init();
            }
        });
    }
});
该getScript()功能实际上可以防止浏览器缓存。如果您运行跟踪,您将看到脚本加载了一个包含时间戳参数的 URL:
http://www.yoursite.com/js/tinymce.js?_=1399055841840
如果用户#addComment多次点击链接,tinymce.js将从不同的时间戳 URL 重新加载。这违背了浏览器缓存的目的。
===
或者,在getScript()文档中有一些示例代码演示如何通过创建自定义cachedScript()函数来启用缓存,如下所示:
jQuery.cachedScript = function( url, options ) {
    // Allow user to set any option except for dataType, cache, and url
    options = $.extend( options || {}, {
        dataType: "script",
        cache: true,
        url: url
    });
    // Use $.ajax() since it is more flexible than $.getScript
    // Return the jqXHR object so we can chain callbacks
    return jQuery.ajax( options );
};
// Usage
$.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) {
    console.log( textStatus );
});
===
或者,如果要全局禁用缓存,可以使用ajaxSetup()以下方法:
$.ajaxSetup({
    cache: true
});