views:

111

answers:

3

Dear all I am using Mootools 1.11 and Jquery 1.2, ajax function not work properly for following code

jQuery(document).ready(function($) {

            confirm("Hello");

            function confirm(message){

                   $.ajax({ 
                    url: 'ajax.php', 
                    ....

                    });                      

             }   

   });

what modification should i do to execute ajax function correctly

A: 

If you're running jQuery in compatibility mode, you should use jQuery.ajax(...) as you already use on the jQuery(document).ready function.

CMS
there's no problem with that part of his code: the ready function takes one parameter, which is the jQuery object, hence, inside that closure, `$` is the same as `jQuery`.
nickf
A: 

Hi, or maybe (Its untested) you can use:

jQuery(document).ready(function(jQuery.noConflict(true)) {

And still use $ inside.

Regards

Ricardo Vega
+1  A: 

confirm is a built-in function (a reserved name)... try using a different name for it.

nickf