在这段代码中:
function comrespond(){
function addresform(){
var resid = this.getAttribute('id'),
grandParent = this.parentNode.parentNode,
newrespondform = '<div class="commentresponse"><span></span><span><p class="author">Leave a reply:</p><form id="commentform" action="http://split.snippetspace.com/wp-comments-post.php" method="post" onsubmit="addcomment(); return false;"><input id="author" aria-required="true" name="author" type="text" placeholder="Your name"/><input id="email" aria-required="true" name="email" type="text" placeholder="Email address" /><textarea id="comment" aria-required="true" name="comment" rows="8"></textarea><input id="submit" name="submit" type="submit" value="Post Comment" /><input id="comment_post_ID" name="comment_post_ID" type="hidden" value="'+resid+'" /></form></span></div>';
grandParent.parentNode.insertBefore(newrespondform, grandParent.nextSibling);
}
var responsebtn = document.getElementsByClassName('comment-reply-link');
for(var i = 0; i < responsebtn.length; i++){
bindEvt(responsebtn[i], "click", addresform);
};
此行在 IE10 中返回为“无效参数”:
grandParent.parentNode.insertBefore(newrespondform, grandParent.nextSibling);
我似乎无法弄清楚这一点。它应该在 cetain div 的祖父母之后插入一段代码。有什么想法吗?:)