matt
matt

Reputation: 44333

inline scripts: jQuery is not defined?

hey guys, i have a certain plugin on my website that adds a inline script segment to my website.

this is the first line of this inline script.

jQuery(document).ready(function($)

jquery 1.5 is loaded in my head. However in my normal script.js file where all my selfmade js is stored I use...

$(document).ready(function(){

Anyway... my problem is that this inline script with jQuery(document)...causes my console to shout: "jQuery is not defined"...

any idea how to fix that? I can't access the inline script!

Upvotes: 0

Views: 2399

Answers (3)

Harold Sota
Harold Sota

Reputation: 7566

Add these before your jquery call: jQuery.noConflict();

Upvotes: 1

Jochem
Jochem

Reputation: 2993

jQuery and $ (usually) refer to the same thing. Check if your jQuery libraries are loaded BEFORE (ie are higher in the HEAD section) your plugin..

Upvotes: 0

Nikhil
Nikhil

Reputation: 3384

If your plugin ends up adding its own scripts before jQuery gets pulled in then yes you will run into this problem. Will you be able to point us to the actual page?

You might want to lazy load the plugin if possible.

Upvotes: 0

Related Questions