2

Does it work, if I specify a folder for Operas userjs and that folder contains jQuery.js? Can I then use jQuery in my own scripts?

2 Answers 2

2

No, don't do that. Not raw and unchecked at least.

It won't work and what you'll find is that sites that already use jQuery may take forever to load nothing but an expectant blank page.

You can try and throw a check around your jquery.js file in your userscripts directory like so:

 if (typeof jQuery != 'undefined') {

    //the jquery.js file is here

 }

That should stop the conflict of having two jQuery libraries loaded on the one page.

No guarantees that that will work though.

0

Or use jQuery No Conflict

Ex:

<script type="text/javascript">
  $.noConflict();
  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });
  // Code that uses other library's $ can follow here.
</script>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .