Jquery and Prototype Conflict
Posted
by patrick
on Stack Overflow
See other posts from Stack Overflow
or by patrick
Published on 2010-05-29T16:57:24Z
Indexed on
2010/05/29
17:12 UTC
Read the original article
Hit count: 253
I am having trouble running two javascript files on the same page. I used JQuery.noConflict() (http://api.jquery.com/jQuery.noConflict/) but no luck.
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("prototype", "1.6.0.3",{uncompressed:false});
google.load("scriptaculous", "1.8.1",{uncompressed:false});
</script>
<script src="js/jquery.tools.min.js"></script>
<script type="text/javascript">
$jQuery.noConflict();
jQuery(document).ready(function($) {
$("#download_now").tooltip({ effect: 'slide'});
});
function show_text() {
new Ajax.Request('./new.php', {
method: 'post',
parameters: { userid: $('userid').value },
onSuccess: function(r) { $('update').update(r.responseText) }
});
}
document.observe("dom:loaded", function() {
$('loading').hide();
Ajax.Responders.register({
onCreate: function() {
new Effect.Opacity('loading',{ from: 1.0, to: 0.3, duration: 0.7 });
new Effect.toggle('loading', 'appear');
},
onComplete: function() {
new Effect.Opacity('loading', { from: 0.3, to: 1, duration: 0.7 });
new Effect.toggle('loading', 'appear');
}
});
});
</script>
© Stack Overflow or respective owner