亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

會導致現在點回復就要刷新一下網頁0_0,這太不科學了!

會導致現在點回復就要刷新一下網頁0_0,這太不科學了!

PHP
MYYA 2023-04-25 23:19:18
使用的Typecho是SVN上下載的,默認的主題也木有加載,這個不是Typecho自動加載的么,不知道什么情況了。
查看完整描述

1 回答

?
小怪獸愛吃肉

TA貢獻1852條經驗 獲得超1個贊

最后是自己將TypechoComment()函數的function提取出來稍作修改最后外部載入解決。下面是我的TypechoComment()函數的function,比較關鍵的是15行獲取response的那部分,需要稍作修改就是。

//<![CDATA[var TypechoComment = {
    dom : function (id) {        return document.getElementById(id);
    },
    
    create : function (tag, attr) {        var el = document.createElement(tag);        
        for (var key in attr) {
            el.setAttribute(key, attr[key]);
        }        
        return el;
    },

    reply : function (cid, coid) {        var comment = this.dom(cid), parent = comment.parentNode,
            response = this.dom(document.getElementById(cid).getElementsByClassName('reply')[0].getElementsByTagName('a')[0].href.split('#')[1]), input = this.dom('comment-parent'),
            form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0],
            textarea = response.getElementsByTagName('textarea')[0];        if (null == input) {
            input = this.create('input', {                'type' : 'hidden',                'name' : 'parent',                'id'   : 'comment-parent'
            });

            form.appendChild(input);
        }
        
        input.setAttribute('value', coid);        if (null == this.dom('comment-form-place-holder')) {            var holder = this.create('div', {                'id' : 'comment-form-place-holder'
            });
            
            response.parentNode.insertBefore(holder, response);
        }

        comment.appendChild(response);        this.dom('cancel-comment-reply-link').style.display = '';        
        if (null != textarea && 'text' == textarea.name) {
            textarea.focus();
        }        
        return false;
    },

    cancelReply : function () {        var response = this.dom('respond-post-183'),
        holder = this.dom('comment-form-place-holder'), input = this.dom('comment-parent');        if (null != input) {
            input.parentNode.removeChild(input);
        }        if (null == holder) {            return true;
        }        this.dom('cancel-comment-reply-link').style.display = 'none';
        holder.parentNode.insertBefore(response, holder);        return false;
    }
}//]]>


查看完整回答
反對 回復 2023-04-28
  • 1 回答
  • 0 關注
  • 125 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號