I am trying to use jQuery in a highly conflict environment. .noConflict() doesn’t work and I am trying to do something like
<script type="text/javascript">
document.write( document.write(unescape("%3Cscript src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
jQuery.noConflict();
var $ = jQuery;
</script>
Any ideas how to fix this ?
Are you sure it has nothing to do with the fact that you have:
That would cause an error and then
noConflictwouldn’t work.Also, do you need to be using Prototype and jQuery at the same time? The whole purpose of
jQuery.noConflict()is to NOT set thejQueryvariable to$because Prototype uses it (I’m sure there are other reasons, but that’s the main one in this case). jQuery and Prototype aren’t good friends, usually.Finally, are you absolutely positive (assuming you don’t have the syntax error in your real code) that jQuery is getting loaded?
Did some quick research. Check this link and see if it helps any:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
Basically, you might have to call jQuery first, and you will have to call Prototype BEFORE you use
noConflict()