سؤال

I include jQuery 1.10, script.aculo.us and Prototype in the same file. It shows the error:

Cannot call method 'click' of undefined

I suspect it is due to library conflict, so I did this:

JQuery(document).ready(function() {...

and move script.aculo.us after all other scripts. Unfortunately it shows:

Uncaught ReferenceError: JQuery is not defined

The solution in Using jQuery noConflict() with script.aculo.us doesn't work for me.

My code

{literal}
    <script src="include/js/jquery-1.10.2.js" type="text/javascript"></script>
    <script src="include/js/general.js" type="text/javascript"></script>

    <script>
        JQuery(document).ready(function() { ...
    </script>

    <script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
    <script src="include/scriptaculous/scriptaculous.js" type="text/javascript"></script>
{/literal}

literal is Smarty tag.

هل كانت مفيدة؟

المحلول

You wrote JQuery, but the J is lower case, so use jQuery(document).ready(function(){...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top