Page 1 of 1

Javascript Conflict?

Posted: Thu Apr 23, 2009 5:55 pm
by millsy007
I have a webpage that uses some ajax to send an email form, this all works fine when this is the only javascript on my page.

It uses mootools.js and the following javascript:

Code: Select all

    <script type="text/javascript">
        window.addEvent('domready', function(){
            $('myForm').addEvent('submit', function(e) {
 
            new Event(e).stop();
            var log = $('log_res').empty().addClass('sending');
            this.send({
                update: log,
                onComplete: function() {
                    log.removeClass('sending');
                }
            });
            });     
        });
    </script>
But as soon as I reference other javascript (prototype, scriptalicious...) this code stops working.

Is this a conflict? Is there something I can do to handle this?

Re: Javascript Conflict?

Posted: Thu Apr 23, 2009 6:19 pm
by jayshields
I'm guessing it is a conflict because they will all probably use the $ character for the function. I know with jQuery you can redefine what character it is to stop conflicts. It's probably the same for the others.