I am getting the exception in firefox 3.6.10

"Illegal operation on WrappedNative prototype object" nsresult:
"0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"
<myfilename>::anonymous::line 172

I am using prototype.js and the line as folows,

var dropInsertBeforeElement = createElement("<div id='drop_insert_before_" + this.id + "' style='height:6px; width:" + totalWidth + "px;'>");

The exact place in prototype.js

var Enumerable = (function() {
  function each(iterator, context) {
    var index = 0;
    try {
      this._each(function(value) {
        iterator.call(context, value, index++);
      });
    } catch (e) {
      if (e != $break) throw e;  // here the exception is gettin 
    }
    return this;
  }

This works fine in IE.

Please help me to figure out the problem.

Please let me know if you need any more information.
Regards,
SSM

instead of:

var dropInsertBeforeElement = createElement("<div id='drop_insert_before_" + this.id + "' style='height:6px; width:" + totalWidth + "px;'>");

try:

var dropInsertBeforeElement = document.createElement("div");
dropInsertBeforeElement.id='drop_insert_before_' + this.id;
dropInsertBeforeElement.style.height='6px';
dropInsertBeforeElement.style.width= totalWidth + 'px';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.