[jQuery] Prototype to Jquery
Let me first begin by saying that I am a total noob to
jquery/prototype/javascript etc.
I am trying to setup a basic mail signup script using one of the examples
from the mail chimp website
(http://www.mailchimp.com/api/downloads/mcapi-simple-subscribe.zip) which
uses prototype however I am already using jquery on my page - I believe it
is conflicting.
The above code still seems to work when I don't use the prototype library
(?) but I still get the following error in the debug - "Event.observe is not
a function" which relates to the following lines of script:
------------------------------------------------------------------------------------------------
// Load Events Listeners
Event.observe(window, 'load', init, false);
function init(){
Event.observe('signup','submit',storeAddress);
}
// AJAX call sending sign up info to store-address.php
function storeAddress(event) {
// Update user interface
$('response').innerHTML = 'Adding email address...';
// Prepare query string and send AJAX request
var pars = 'ajax=true&email=' + escape($F('email'));
var myAjax = new Ajax.Updater('response', 'inc/store-address.php', {method:
'get', parameters: pars});
Event.stop(event); // Stop form from submitting when JS is enabled
}
-------------------------------------------------------------------------------------------------
I understand that Event.observe is a "prototype" call (?) so I was wondering
if there is an equivalent jquery call i can use/replace it with? Or some
other way to stop the error.
Any information for this noob would be greatly appreciated.
Cheers
--
View this message in context: http://www.nabble.com/Prototype-to-Jquery-tp20030751s27240p20030751.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.