1,105,546 Community Members

Illegal operation on WrappedNative prototype object

Member Avatar
SSMuller
Newbie Poster
1 post since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
hielo
Veteran Poster
1,131 posts since Dec 2007
Reputation Points: 55 [?]
Q&As Helped to Solve: 246 [?]
Skill Endorsements: 0 [?]
 
0
 

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';
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article