I am getting this error when the imageassist javascript loads:
Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function

The javascript console is giving me the following info:

Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function
(anonymous function)drupal.js:42

Any ideas what might cause this?


sun’s picture

Status:Active» Closed (cannot reproduce)

This means that jQuery is loaded after Image Assist, which should not happen.

nicholasThompson’s picture

I'm getting this same error with a custom script in my theme...

Drupal.behaviors.expandcode = {
  attach: function(context) {
    $('div.findme', context).each(function() {
      // Run me...
nicholasThompson’s picture

So - turns out JQuery in Drupal 7 has changed to allow for other libraries to function without conflicts. See: http://drupal.org/node/756722

philosurfer’s picture

Issue tags:+jQuery, +drupal 7

It would have been nice to know this sooner!!!

I was having to use "jQuery()" instead of "$()"
and going nuts because of it.... ;-P

for those of you that did not read past this thread onto the link...
to use jQuery in D7 you need to wrap your code in this:

(function ($) {
  // All your code here
sameronline’s picture

Thanks philosurfer this hepled me as well and saved me alot of time.

jnthnmyrs’s picture

Wonderful! Thank you nicholasThompson and philosurfer! I am no longer confused. :)

philosurfer’s picture

Seeing as this is an old thread....

I highly recommend reading this for understanding JavaScript and Drupal. Drupal. behaviors is very powerful


lokinder.chauhan’s picture

Thanks man you saved me

hilrap’s picture

Issue summary:View changes

How would you wrap

$(".more-block").each(function () {

            if ....