Search code examples
phpprototypejs

IE display error in prototype.js line no. 1597


i m using lightwindow using prototype.js, IE display error when lighwindow appear, i m writing lines where problem occur, please suggest me where is the error and how to rectifi it

setStyle: function(element, styles, camelized) {
    element = $(element);
    var elementStyle = element.style;

    for (var property in styles)
      if (property == 'opacity') element.setOpacity(styles[property])
      else
        elementStyle[(property == 'float' || property == 'cssFloat') ? // error show in this line
          (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
          (camelized ? property : property.camelize())] = styles[property];

    return element;
  },

Solution

  • The prototype.js code is most likely fine, it's probably a setStyle() call on an element that doesn't exist.

    If you use Internet Explorer 8, press F12 to open the developer tools. Change to the "script" tab and then find the Stack Trace. The stack trace will show you the point where the offending setStyle() call was made. That might already give you a hint wnat's wrong; if it doesn't, come back with that info.

    You can do the same with Firefox and Firebug.