你不能检查 jQuery 的存在并在那之后仍然加载 jCarousel 吗?
<script type="text/javascript">
    if (typeof jQuery === "undefined") {  
        document.write('<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"><\/script>');
    }
</script>
<script src="http://path/to/jcarousel" type="text/javascript"></script>
再三考虑,我不相信这会永远有效。我认为这不能保证 jQuery 会在 jCarousel 之前加载。我想出了一个似乎更强大的替代解决方案。它确保 jQuery 已加载,然后使用 jQuery 加载使用$.getScript(). 然后你的代码从getScript. 这确保了一切都以正确的顺序发生:
<script type="text/javascript">
    if (typeof jQuery !== "undefined") {
        loadLibs();
    } else {
        var script = document.createElement('script');
        script.src = 'http://code.jquery.com/jquery.js';
        document.getElementsByTagName('head')[0].appendChild(script);
        var timeout = 100; // 100x100ms = 10 seconds
        var interval = setInterval(function() {
            timeout--;
            if (window.jQuery) {
                clearInterval(interval);
                loadLibs();
            } else if (timeout <= 0) {
                // jQuery failed to load
                clearInterval(interval);
            }
        }, 100);
    }
    function loadLibs() {
        $.getScript("http://sorgalla.com/projects/jcarousel/lib/jquery.jcarousel.min.js", function(data, textStatus, jqxhr) {
            myCode();
        });
    }
    function myCode() {
        $(document).ready(function() {
            $('#mycarousel').jcarousel();
        });
    }
</script>
演示:http: //jsfiddle.net/jtbowden/Y84hA/2/
(将左栏中的框架更改为任何版本的 jQuery 或其他库。它应该始终正确加载轮播)
编辑:
这个版本是类似的,但是<head>对 lib 使用了一个负载,就像 jQuery 一样。它比$.getScript():
http://jsfiddle.net/jtbowden/y8nGJ/1/