未捕获的错误NOT_FOUND_ERR DOM异常8

6 javascript exception appendchild

所以我删除特定div下的所有内容并添加消息内容.但是,javascript在完成后抛出以下错误:

Uncaught Error: NOT_FOUND_ERR: DOM Exception 8
Run Code Online (Sandbox Code Playgroud)

这是执行它的代码

 new Ajax.Request("profileThis.php",
 {
   method:'post',

   parameters:{title:title, review:review, userId:userId, category:category, categoryId:categoryId},

   onSuccess:function(ajax) 
   {
    alert(ajax.responseText); // this is just for debugging purposes

    var message=ajax.responseText;

    var divMessage=document.createElement("div");

    divMessage.style.color="rgb:(105,105,105)";

    divMessage.innerHTML=message;

    while($("reviewSheet").hasChildNodes)
    {
     $("reviewSheet").removeChild($("reviewSheet").lastChild);
    }

    $("reviewSheet").adopt(divMessage);         

   },

   onFailure:ajaxFailure,

   onException:ajaxFailure

 });
Run Code Online (Sandbox Code Playgroud)

人们评论说,问题在于我的分配divMessage方式reviewSheet.我试过了两个adopt,appendChild但都没有.一点帮助将不胜感激.

epa*_*llo 3

divMessage.style.color="rgb:(105,105,105)";
Run Code Online (Sandbox Code Playgroud)

应该

divMessage.style.color="rgb(105,105,105)";
Run Code Online (Sandbox Code Playgroud)