views:

144

answers:

3

on a webpage in under developmnt i'm getting this error on IE

element = $(element);   

this code is in prototype.js

Object expected

How to get rid of this error.

Update:

jQuery is also being used on site.

+3  A: 

Is "element" the id of your element? If so try making it element = $("element")

Tim Goodman
+2  A: 

your statement should be

element = $("id of element")

suppose you have the following code.

<div id="mainDiv">
  ...
</div>

To access this control, in prototype, it is

element = $("mainDiv");

UPDATE:

Based on your comment, you can combine both jquery and prototype in the same page.

var J = jQuery.noConflict();

After this statement, $("#foo") will be J("#foo").

See this stackoverflow question

Adeel
jquery is also being used on site can this could be a issue
metal-gear-solid
A: 

You need to put a var in front of the variable assignment when the variable and element id are the same in IE.

var element = $(element);
Christian