On Dec 11, 7:14 am, Henjo <henjohoek...@gmail.com> wrote:
> I am wondering how to set my jQuery to be in 'noconflict' state.
> [ ... ]
>    function questionList(){
>       ...
>    }

I'm wondering if you are using the "$" shortcut to jQuery inside such
functions.  If you are, then those functions must be inside some scope
which redefines "$", because in the global scope, "$" is referring to
Prototype.  You can fix this by using "jQuery" instead of "$" in your
functions, or by wrapping them in a scope which defines "$"
temporarily to jQuery.  You can do this by putting them inside your
document ready block the way you list above, supplying "$" as the
parameter to your function, or by wrapping them in a scope like this:

    // in the global scope here, $ refers to Prototype
    (function($) {
        // here $ refers to jQuery.
        function questionList() {
            // and you can use $ for jQuery inside this function.
        }
    })(jQuery);
    // again here, $ refers to Prototype

If by some chance you have blocks of script that want to use both
Prototype and jQuery, you simply have to avoid using "$" for jQuery,
although you can define your own shortcut like so:

    var $jq = jQuery.noConflict();

Cheers,

  -- Scott

Reply via email to