{"id":4721,"date":"2025-10-20T10:48:56","date_gmt":"2025-10-20T02:48:56","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wenda\/4721.html"},"modified":"2025-10-20T10:58:24","modified_gmt":"2025-10-20T02:58:24","slug":"%e5%9c%a8wordpress%e7%bd%91%e7%ab%99%e9%a1%b5%e9%9d%a2%e4%b8%ad%ef%bc%8c%e5%9b%a0%e4%b8%baajax%e9%95%bf%e8%bd%ae%e8%af%a2%e4%b8%8d%e5%81%9c%e7%9a%84%e4%b8%ba%e5%bd%93%e5%89%8d%e9%a1%b5%e9%9d%a2","status":"publish","type":"wenda","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/wenda\/4721.html","title":{"rendered":"\u5728WordPress\u7f51\u7ad9\u9875\u9762\u4e2d\uff0c\u56e0\u4e3aAjax\u957f\u8f6e\u8be2\u4e0d\u505c\u7684\u4e3a\u5f53\u524d\u9875\u9762\u6dfb\u52a0\u6570\u5343\u4e2a\u9875\u9762\u5730\u5740\u94fe\u63a5\uff0c\u9020\u6210\u9875\u9762\u65e0\u54cd\u5e94\u3002\u8fd9\u79cd\u60c5\u51b5\u7684\u89e3\u51b3\u529e\u6cd5\u6709\u54ea\u4e9b\uff1f"},"content":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u5178\u578b\u7684\u6027\u80fd\u95ee\u9898\uff0c\u4e3b\u8981\u662f\u7531\u4e8e\u5927\u91cfDOM\u64cd\u4f5c\u5bfc\u81f4\u6d4f\u89c8\u5668\u5185\u5b58\u8017\u5c3d\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u89e3\u51b3\u65b9\u6848\uff1a<\/p><h2 class=\"wp-block-heading\">1. \u524d\u7aef\u4f18\u5316\u65b9\u6848<\/h2><h3 class=\"wp-block-heading\">\u5206\u9875\/\u61d2\u52a0\u8f7d<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u5206\u6279\u52a0\u8f7d\u6570\u636e\nlet currentPage = 1;\nconst pageSize = 50;\n\nfunction loadDataBatch() {\n    $.ajax({\n        url: ajaxurl,\n        data: {\n            action: 'my_ajax_action',\n            page: currentPage,\n            page_size: pageSize\n        },\n        success: function(response) {\n            if (response.data &amp;&amp; response.data.length &gt; 0) {\n                appendLinksBatch(response.data);\n                currentPage++;\n\n                \/\/ \u5982\u679c\u6709\u66f4\u591a\u6570\u636e\uff0c\u7ee7\u7eed\u52a0\u8f7d\n                if (response.has_more) {\n                    setTimeout(loadDataBatch, 100); \/\/ \u6dfb\u52a0\u5ef6\u8fdf\u907f\u514d\u963b\u585e\n                }\n            }\n        }\n    });\n}<\/code><\/pre><h3 class=\"wp-block-heading\">\u865a\u62df\u6eda\u52a8<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u53ea\u6e32\u67d3\u53ef\u89c1\u533a\u57df\u7684\u94fe\u63a5\nfunction renderVisibleLinks(links, container, scrollTop, containerHeight) {\n    const linkHeight = 30; \/\/ \u9884\u4f30\u6bcf\u4e2a\u94fe\u63a5\u9ad8\u5ea6\n    const startIndex = Math.floor(scrollTop \/ linkHeight);\n    const endIndex = Math.min(\n        startIndex + Math.ceil(containerHeight \/ linkHeight) + 5,\n        links.length\n    );\n\n    const visibleLinks = links.slice(startIndex, endIndex);\n    container.innerHTML = '';\n    visibleLinks.forEach(link =&gt; {\n        container.appendChild(createLinkElement(link));\n    });\n}<\/code><\/pre><h2 class=\"wp-block-heading\">2. \u540e\u7aef\u4f18\u5316\u65b9\u6848<\/h2><h3 class=\"wp-block-heading\">\u9650\u5236\u8fd4\u56de\u6570\u636e\u91cf<\/h3><pre class=\"wp-block-code\"><code>\/\/ WordPress Ajax\u5904\u7406\nadd_action('wp_ajax_my_ajax_action', 'handle_ajax_request');\nadd_action('wp_ajax_nopriv_my_ajax_action', 'handle_ajax_request');\n\nfunction handle_ajax_request() {\n    $page = isset($_POST['page']) ? intval($_POST['page']) : 1;\n    $page_size = isset($_POST['page_size']) ? intval($_POST['page_size']) : 50;\n\n    $offset = ($page - 1) * $page_size;\n\n    \/\/ \u83b7\u53d6\u5206\u9875\u6570\u636e\n    $links = get_links_batch($offset, $page_size);\n    $total_links = get_total_links_count();\n\n    wp_send_json_success([\n        'data' =&gt; $links,\n        'has_more' =&gt; ($offset + count($links)) &lt; $total_links,\n        'total' =&gt; $total_links\n    ]);\n}<\/code><\/pre><h2 class=\"wp-block-heading\">3. \u67b6\u6784\u4f18\u5316\u65b9\u6848<\/h2><h3 class=\"wp-block-heading\">WebSocket\u66ff\u4ee3\u957f\u8f6e\u8be2<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u4f7f\u7528WebSocket\u5b9e\u73b0\u5b9e\u65f6\u66f4\u65b0\nconst socket = new WebSocket('ws:\/\/yoursite.com\/ws');\n\nsocket.onmessage = function(event) {\n    const newLinks = JSON.parse(event.data);\n    appendNewLinks(newLinks); \/\/ \u53ea\u6dfb\u52a0\u65b0\u94fe\u63a5\n};<\/code><\/pre><h3 class=\"wp-block-heading\">Server-Sent Events (SSE)<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u4f7f\u7528SSE\nconst eventSource = new EventSource('\/api\/links-stream');\n\neventSource.onmessage = function(event) {\n    const newLink = JSON.parse(event.data);\n    appendSingleLink(newLink); \/\/ \u6bcf\u6b21\u53ea\u6dfb\u52a0\u4e00\u4e2a\u94fe\u63a5\n};<\/code><\/pre><h2 class=\"wp-block-heading\">4. \u5185\u5b58\u7ba1\u7406\u65b9\u6848<\/h2><h3 class=\"wp-block-heading\">\u6e05\u7406\u65e7\u6570\u636e<\/h3><pre class=\"wp-block-code\"><code>const MAX_LINKS = 1000;\n\nfunction appendLinkWithCleanup(link) {\n    const container = document.getElementById('links-container');\n    const links = container.getElementsByTagName('a');\n\n    \/\/ \u5982\u679c\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u79fb\u9664\u6700\u65e7\u7684\u94fe\u63a5\n    if (links.length &gt;= MAX_LINKS) {\n        for (let i = 0; i &lt; 10; i++) { \/\/ \u4e00\u6b21\u79fb\u966410\u4e2a\n            if (links[0]) {\n                links[0].remove();\n            }\n        }\n    }\n\n    \/\/ \u6dfb\u52a0\u65b0\u94fe\u63a5\n    container.appendChild(createLinkElement(link));\n}<\/code><\/pre><h2 class=\"wp-block-heading\">5. \u7528\u6237\u4f53\u9a8c\u4f18\u5316<\/h2><h3 class=\"wp-block-heading\">\u641c\u7d22\u548c\u8fc7\u6ee4<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u6dfb\u52a0\u641c\u7d22\u529f\u80fd\u51cf\u5c11\u663e\u793a\u6570\u91cf\nfunction filterLinks(searchTerm) {\n    const allLinks = getAllLinksFromStorage(); \/\/ \u4ece\u5b58\u50a8\u83b7\u53d6\u6240\u6709\u94fe\u63a5\n    const filtered = allLinks.filter(link =&gt; \n        link.text.includes(searchTerm) || link.url.includes(searchTerm)\n    );\n    renderLinks(filtered);\n}<\/code><\/pre><h3 class=\"wp-block-heading\">\u6298\u53e0\/\u5206\u7ec4\u663e\u793a<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u6309\u57df\u540d\u5206\u7ec4\u94fe\u63a5\nfunction groupLinksByDomain(links) {\n    const groups = {};\n\n    links.forEach(link =&gt; {\n        const domain = extractDomain(link.url);\n        if (!groups[domain]) {\n            groups[domain] = [];\n        }\n        groups[domain].push(link);\n    });\n\n    renderGroupedLinks(groups);\n}<\/code><\/pre><h2 class=\"wp-block-heading\">\u63a8\u8350\u5b9e\u65bd\u65b9\u6848<\/h2><ol class=\"wp-block-list\">\n<li><strong>\u7acb\u5373\u5b9e\u65bd<\/strong>\uff1a\u540e\u7aef\u5206\u9875 + \u524d\u7aef\u5206\u6279\u52a0\u8f7d<\/li>\n\n\n\n<li><strong>\u4e2d\u671f\u4f18\u5316<\/strong>\uff1a\u6dfb\u52a0\u641c\u7d22\u8fc7\u6ee4\u548c\u5206\u7ec4\u663e\u793a<\/li>\n\n\n\n<li><strong>\u957f\u671f\u65b9\u6848<\/strong>\uff1a\u8003\u8651WebSocket\u6216SSE\u66ff\u4ee3\u957f\u8f6e\u8be2<\/li>\n<\/ol><p>\u8fd9\u6837\u65e2\u80fd\u89e3\u51b3\u5f53\u524d\u7684\u6027\u80fd\u95ee\u9898\uff0c\u53c8\u80fd\u63d0\u4f9b\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3002<\/p><h2 class=\"wp-block-heading\">.txt\u6587\u4ef6\u65b9\u6cd5\u7684\u95ee\u9898<\/h2><p>Ajax\u957f\u8f6e\u8be2\u4e2d\uff1a\u5982\u679c\u6211\u5c06\u4ea4\u4e92\u7684\u6570\u636e\u6bcf\u4e00\u6b21\u83b7\u5f97\u4ea4\u4e92\u6570\u636e\uff08\u4e00\u884c\u6587\u672c\uff1a\u65f6\u95f4+url\u5730\u5740\uff09\u90fd\u653e\u5728\u4e00\u4e2a.txt\u6587\u4ef6\u4e2d\uff0c\u5c06\u8be5.txt\u5f15\u5165\u5230\u9875\u9762\u663e\u793a\u3002<br>\u4f7f\u7528\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u662f\u5426\u53ef\u4ee5\u89e3\u51b3\u4ee5\u4e0a\u95ee\u9898\uff1f<\/p><p>\u8fd9\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u601d\u8def\u8f6c\u6362\uff01\u5c06\u6570\u636e\u5199\u5165\u6587\u672c\u6587\u4ef6\u7136\u540e\u5f15\u5165\u9875\u9762\u663e\u793a\u786e\u5b9e\u53ef\u4ee5\u89e3\u51b3DOM\u64cd\u4f5c\u5bfc\u81f4\u7684\u6027\u80fd\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u5b9e\u65bd\u65b9\u6848\u548c\u6ce8\u610f\u4e8b\u9879\uff1a<\/p><h3 class=\"wp-block-heading\">\u5b9e\u65bd\u65b9\u6848<\/h3><h4 class=\"wp-block-heading\">1. \u540e\u7aef\u6570\u636e\u5199\u5165<\/h4><pre class=\"wp-block-code\"><code>\/\/ WordPress Ajax\u5904\u7406\u51fd\u6570\nadd_action('wp_ajax_log_interaction', 'log_interaction_data');\nadd_action('wp_ajax_nopriv_log_interaction', 'log_interaction_data');\n\nfunction log_interaction_data() {\n    $time = current_time('Y-m-d H:i:s');\n    $status = sanitize_text_field($_POST['status']);\n    $url = esc_url_raw($_POST['url']);\n\n    \/\/ \u683c\u5f0f\u5316\u65e5\u5fd7\u884c\n    $log_line = sprintf(\"[%s] %s - %sn\", $time, $status, $url);\n\n    \/\/ \u5199\u5165\u6587\u4ef6\n    $log_file = WP_CONTENT_DIR . '\/interaction-log.txt';\n    file_put_contents($log_file, $log_line, FILE_APPEND | LOCK_EX);\n\n    wp_send_json_success();\n}<\/code><\/pre><h4 class=\"wp-block-heading\">2. \u524d\u7aefAjax\u8c03\u7528<\/h4><pre class=\"wp-block-code\"><code>function logInteraction(status, url) {\n    jQuery.ajax({\n        url: ajaxurl,\n        type: 'POST',\n        data: {\n            action: 'log_interaction',\n            status: status,\n            url: url\n        }\n    });\n}\n\n\/\/ \u5728\u957f\u8f6e\u8be2\u4e2d\u4f7f\u7528\nfunction handleLongPollingResponse(response) {\n    \/\/ \u4e0d\u518d\u76f4\u63a5\u64cd\u4f5cDOM\uff0c\u800c\u662f\u5199\u5165\u6587\u4ef6\n    logInteraction('success', response.url);\n}<\/code><\/pre><h4 class=\"wp-block-heading\">3. \u5728\u9875\u9762\u4e2d\u663e\u793a\u65e5\u5fd7\u6587\u4ef6<\/h4><pre class=\"wp-block-code\"><code>\/\/ \u521b\u5efa\u77ed\u4ee3\u7801\u6765\u663e\u793a\u65e5\u5fd7\nadd_shortcode('display_interaction_log', 'display_interaction_log');\n\nfunction display_interaction_log() {\n    $log_file = WP_CONTENT_DIR . '\/interaction-log.txt';\n\n    if (!file_exists($log_file)) {\n        return '&lt;div class=\"log-container\"&gt;\u6682\u65e0\u6570\u636e&lt;\/div&gt;';\n    }\n\n    $content = file_get_contents($log_file);\n    $lines = explode(\"n\", $content);\n    $recent_lines = array_slice($lines, -100); \/\/ \u53ea\u663e\u793a\u6700\u8fd1100\u884c\n\n    ob_start();\n    ?&gt;\n    &lt;div class=\"interaction-log-container\"&gt;\n        &lt;h3&gt;\u4ea4\u4e92\u65e5\u5fd7&lt;\/h3&gt;\n        &lt;div class=\"log-controls\"&gt;\n            &lt;button onclick=\"refreshLog()\"&gt;\u5237\u65b0&lt;\/button&gt;\n            &lt;button onclick=\"clearLog()\"&gt;\u6e05\u7a7a\u65e5\u5fd7&lt;\/button&gt;\n        &lt;\/div&gt;\n        &lt;pre class=\"log-content\"&gt;&lt;?php echo esc_html(implode(\"n\", $recent_lines)); ?&gt;&lt;\/pre&gt;\n    &lt;\/div&gt;\n\n    &lt;script&gt;\n    function refreshLog() {\n        jQuery.get('&lt;?php echo content_url(); ?&gt;\/interaction-log.txt?' + Date.now(), function(data) {\n            jQuery('.log-content').text(data);\n        });\n    }\n\n    \/\/ \u81ea\u52a8\u5237\u65b0\n    setInterval(refreshLog, 5000);\n    &lt;\/script&gt;\n\n    &lt;style&gt;\n    .interaction-log-container {\n        max-height: 500px;\n        overflow: auto;\n        border: 1px solid #ccc;\n        padding: 10px;\n        background: #f9f9f9;\n    }\n    .log-content {\n        white-space: pre-wrap;\n        font-family: monospace;\n        font-size: 12px;\n    }\n    &lt;\/style&gt;\n    &lt;?php\n    return ob_get_clean();\n}<\/code><\/pre><h3 class=\"wp-block-heading\">\u4f18\u5316\u7248\u672c<\/h3><h4 class=\"wp-block-heading\">1. \u5e26\u5206\u9875\u7684\u65e5\u5fd7\u663e\u793a<\/h4><pre class=\"wp-block-code\"><code>function display_paginated_log() {\n    $log_file = WP_CONTENT_DIR . '\/interaction-log.txt';\n\n    if (!file_exists($log_file)) {\n        return '\u6682\u65e0\u6570\u636e';\n    }\n\n    $page = isset($_GET['log_page']) ? intval($_GET['log_page']) : 1;\n    $lines_per_page = 50;\n\n    $content = file_get_contents($log_file);\n    $all_lines = array_filter(explode(\"n\", $content));\n    $total_lines = count($all_lines);\n    $total_pages = ceil($total_lines \/ $lines_per_page);\n\n    $start = ($page - 1) * $lines_per_page;\n    $display_lines = array_slice($all_lines, $start, $lines_per_page);\n\n    ob_start();\n    ?&gt;\n    &lt;div class=\"paginated-log\"&gt;\n        &lt;div class=\"log-header\"&gt;\n            &lt;h4&gt;\u4ea4\u4e92\u65e5\u5fd7 (\u5171 &lt;?php echo $total_lines; ?&gt; \u884c)&lt;\/h4&gt;\n            &lt;div class=\"pagination\"&gt;\n                &lt;?php for ($i = 1; $i &lt;= $total_pages; $i++): ?&gt;\n                    &lt;a href=\"?log_page=&lt;?php echo $i; ?&gt;\" &lt;?php echo $i == $page ? 'class=\"current\"' : ''; ?&gt;&gt;\n                        &lt;?php echo $i; ?&gt;\n                    &lt;\/a&gt;\n                &lt;?php endfor; ?&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n        &lt;pre class=\"log-content\"&gt;&lt;?php echo esc_html(implode(\"n\", $display_lines)); ?&gt;&lt;\/pre&gt;\n    &lt;\/div&gt;\n    &lt;?php\n    return ob_get_clean();\n}<\/code><\/pre><h4 class=\"wp-block-heading\">2. \u81ea\u52a8\u65e5\u5fd7\u8f6e\u8f6c<\/h4><pre class=\"wp-block-code\"><code>\/\/ \u9632\u6b62\u65e5\u5fd7\u6587\u4ef6\u8fc7\u5927\nfunction ensure_log_size() {\n    $log_file = WP_CONTENT_DIR . '\/interaction-log.txt';\n    $max_size = 5 * 1024 * 1024; \/\/ 5MB\n\n    if (file_exists($log_file) &amp;&amp; filesize($log_file) &gt; $max_size) {\n        $content = file_get_contents($log_file);\n        $lines = explode(\"n\", $content);\n        \/\/ \u4fdd\u7559\u6700\u8fd11000\u884c\n        $recent_lines = array_slice($lines, -1000);\n        file_put_contents($log_file, implode(\"n\", $recent_lines));\n    }\n}<\/code><\/pre><h3 class=\"wp-block-heading\">\u4f18\u52bf\u5206\u6790<\/h3><p>\u2705 <strong>\u89e3\u51b3\u4e86\u6027\u80fd\u95ee\u9898<\/strong>\uff1a<\/p><ul class=\"wp-block-list\">\n<li>\u4e0d\u518d\u6709\u5927\u91cfDOM\u64cd\u4f5c<\/li>\n\n\n\n<li>\u6d4f\u89c8\u5668\u4e0d\u4f1a\u56e0\u4e3a\u6570\u5343\u4e2a\u94fe\u63a5\u800c\u5361\u6b7b<\/li>\n\n\n\n<li>\u5185\u5b58\u4f7f\u7528\u7a33\u5b9a<\/li>\n<\/ul><p>\u2705 <strong>\u6570\u636e\u6301\u4e45\u5316<\/strong>\uff1a<\/p><ul class=\"wp-block-list\">\n<li>\u6570\u636e\u4fdd\u5b58\u5728\u670d\u52a1\u5668\u7aef<\/li>\n\n\n\n<li>\u5237\u65b0\u9875\u9762\u4e0d\u4f1a\u4e22\u5931\u6570\u636e<\/li>\n\n\n\n<li>\u53ef\u4ee5\u957f\u671f\u4fdd\u5b58\u5386\u53f2\u8bb0\u5f55<\/li>\n<\/ul><p>\u2705 <strong>\u7075\u6d3b\u7684\u67e5\u770b\u65b9\u5f0f<\/strong>\uff1a<\/p><ul class=\"wp-block-list\">\n<li>\u53ef\u4ee5\u5206\u9875\u67e5\u770b<\/li>\n\n\n\n<li>\u652f\u6301\u641c\u7d22\uff08\u901a\u8fc7\u6587\u4ef6\u5185\u5bb9\u641c\u7d22\uff09<\/li>\n\n\n\n<li>\u53ef\u4ee5\u5bfc\u51fa\u65e5\u5fd7\u6587\u4ef6<\/li>\n<\/ul><h3 class=\"wp-block-heading\">\u6f5c\u5728\u8003\u8651<\/h3><p>\u26a0\ufe0f <strong>\u670d\u52a1\u5668IO\u538b\u529b<\/strong>\uff1a\u9891\u7e41\u7684\u6587\u4ef6\u5199\u5165\u53ef\u80fd\u5bf9\u670d\u52a1\u5668\u6709\u538b\u529b<br>\u26a0\ufe0f <strong>\u5e76\u53d1\u5199\u5165<\/strong>\uff1a\u591a\u7528\u6237\u540c\u65f6\u5199\u5165\u9700\u8981\u8003\u8651\u6587\u4ef6\u9501<br>\u26a0\ufe0f <strong>\u5b89\u5168\u6027<\/strong>\uff1a\u786e\u4fdd\u65e5\u5fd7\u6587\u4ef6\u4e0d\u80fd\u76f4\u63a5\u901a\u8fc7URL\u8bbf\u95ee<\/p><h3 class=\"wp-block-heading\">\u5b89\u5168\u63aa\u65bd<\/h3><pre class=\"wp-block-code\"><code>\/\/ \u9632\u6b62\u76f4\u63a5\u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6\n\/\/ \u5728wp-content\u76ee\u5f55\u521b\u5efa.htaccess\uff08\u5982\u679c\u4f7f\u7528Apache\uff09\n# \u963b\u6b62\u76f4\u63a5\u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6\n&lt;Files \"interaction-log.txt\"&gt;\n    Order Allow,Deny\n    Deny from all\n&lt;\/Files&gt;<\/code><\/pre><h3 class=\"wp-block-heading\">\u6709\u6548\u89e3\u51b3<\/h3><p>\u8fd9\u4e2a\u65b9\u6848\u786e\u5b9e\u53ef\u4ee5\u6709\u6548\u89e3\u51b3\u539f\u95ee\u9898\uff0c<strong>\u7279\u522b\u9002\u5408\u4ee5\u4e0b\u573a\u666f<\/strong>\uff1a<\/p><ul class=\"wp-block-list\">\n<li>\u4e3b\u8981\u662f\u67e5\u770b\u548c\u76d1\u63a7\u9700\u6c42\uff0c\u800c\u975e\u5b9e\u65f6\u4ea4\u4e92<\/li>\n\n\n\n<li>\u6570\u636e\u91cf\u5f88\u5927\uff0c\u9700\u8981\u6301\u4e45\u5316\u5b58\u50a8<\/li>\n\n\n\n<li>\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u4e0d\u662f\u6781\u9ad8<\/li>\n<\/ul><p>\u76f8\u6bd4\u76f4\u63a5\u5728\u9875\u9762\u6dfb\u52a0DOM\u5143\u7d20\uff0c\u8fd9\u4e2a\u65b9\u6848\u66f4\u52a0\u7a33\u5b9a\u548c\u53ef\u6269\u5c55\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u5178\u578b\u7684\u6027\u80fd\u95ee\u9898\uff0c\u4e3b\u8981\u662f\u7531\u4e8e\u5927\u91cfDOM\u64cd\u4f5c\u5bfc\u81f4\u6d4f\u89c8\u5668\u5185\u5b58\u8017\u5c3d\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u89e3\u51b3\u65b9\u6848\uff1a 1. \u524d\u7aef\u4f18\u5316\u65b9\u6848 \u5206\u9875\/\u61d2\u52a0\u8f7d \u865a\u62df\u6eda\u52a8 2. \u540e\u7aef\u4f18\u5316\u65b9\u6848 \u9650\u5236\u8fd4\u56de\u6570\u636e\u91cf 3. \u67b6\u6784\u4f18\u5316\u65b9\u6848 WebSocket\u66ff\u4ee3\u957f\u8f6e\u8be2 Server-Sent Events (SSE) 4. \u5185\u5b58\u7ba1\u7406\u65b9\u6848 \u6e05\u7406\u65e7\u6570\u636e 5. \u7528\u6237\u4f53\u9a8c\u4f18\u5316..<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false},"tags":[],"wenda2nav":[3264],"tuisongtax":[],"class_list":["post-4721","wenda","type-wenda","status-publish","hentry","wenda2nav-wzyh"],"acf":{"qian_art_seotitle":"","qian_art_seotitle_source":{"label":"SEO\u6807\u9898","type":"text","formatted_value":""},"qian_art_seokws":"","qian_art_seokws_source":{"label":"SEO\u5173\u952e\u8bcd","type":"text","formatted_value":""},"qian_art_stzhong":"Ajax\u957f\u8f6e\u8be2\u9875\u9762\u52a0\u8f7d\u65e0\u54cd\u5e94","qian_art_stzhong_source":{"label":"\u4e2d | \u77ed\u6807\u9898","type":"text","formatted_value":"Ajax\u957f\u8f6e\u8be2\u9875\u9762\u52a0\u8f7d\u65e0\u54cd\u5e94"}},"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/wenda\/4721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/wenda"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/wenda"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=4721"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=4721"},{"taxonomy":"wenda2nav","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/wenda2nav?post=4721"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=4721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}