jfr
jfr

Reputation: 11

Javascript error in magento

In my magento website i have a problem with some javascript. Most of my theme extensions which uses javascript don't work. It's related to jQuery.

When i use firebug i get this error:

Fout: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMWindow.getComputedStyle]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://REMOVED/js/jquery/jquery.js :: :: line 12" data: no]

I have no idea what this is. Maybe someone can help me in the right direction.

Upvotes: 1

Views: 1050

Answers (3)

psanchet
psanchet

Reputation: 11

You need to add :

if (elem == document) elem = document.body;

before your var computedStyle is declared.

This works for me.

Upvotes: 1

kapex
kapex

Reputation: 30009

I got this error in a jQuery event function. I called the function manually, providing an event object. A call to $(this) inside of the function caused that very error. Without triggering the event correctly, jQuery won't set the this object for you.

Upvotes: 0

Charles R
Charles R

Reputation: 441

I got this error when I was passing an empty string to a "news ticker" plugin. My guess is that the plugin was attempting to get the style information from an element which didn't exist (hence nsIDOMWindow.getComputedStyle). Check your AJAX responses for empty strings, which was my problem.

Upvotes: 0

Related Questions