久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 php 和 jquery 的簡(jiǎn)單彗星示例

Simple comet example using php and jquery(使用 php 和 jquery 的簡(jiǎn)單彗星示例)
本文介紹了使用 php 和 jquery 的簡(jiǎn)單彗星示例的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

誰(shuí)能給我一個(gè)簡(jiǎn)單的使用 PHP 的彗星技術(shù)示例?

Can anyone give me a good and simple example of the comet technique using PHP?

我只需要一個(gè)使用持久 HTTP 連接或類(lèi)似內(nèi)容的示例.我不想使用輪詢(xún)技術(shù),因?yàn)槲矣蓄?lèi)似的設(shè)置,不僅難以使用和管理它的大量資源.另外我使用的是 IIS7 而不是 Apache.

I just need an example that uses a persistent HTTP connection or something similar. I don't want to use a polling technique, because I have something like that set up and not only is it difficult to work with and manage its a big hog of resources. Also I am using IIS7 not Apache.

一個(gè)很好的例子會(huì)很有幫助,這樣我就可以繼續(xù)使用這種丑陋的投票技術(shù).

A good example would be really helpful so I can move on from this ugly polling technique.

推薦答案

你應(yīng)該使用輪詢(xún),或者使用一個(gè)專(zhuān)門(mén)為長(zhǎng)請(qǐng)求和 COMET 設(shè)計(jì)的 web 服務(wù)器,有一個(gè)好的 JS 后端:

You should use polling, or use a web server which is specially conceived for long requests and COMET, with a good JS backend:

function listen() {
    $.get("/mylongrequestfile", {}, function(data) {
        $("#mydiv").html(data);
        listen(); // then launch again
    }));
};

記住COMET是等待數(shù)據(jù),有數(shù)據(jù)返回退出",所以JS后端要解析數(shù)據(jù),重新啟動(dòng)詢(xún)問(wèn)服務(wù)器的過(guò)程.

Remember that COMET is "wait for data, if there's data return and exit", so JS backend will have to parse the data and re-launch the process of asking the server.

在這個(gè)例子中,如果出現(xiàn)服務(wù)器端問(wèn)題或者只是與用戶(hù)端斷開(kāi)連接,整個(gè)過(guò)程都會(huì)被破壞(只有請(qǐng)求成功才會(huì)調(diào)用該函數(shù))

In this example, if there is a server side problem or just a disconnection from the user side, the entire process will be broken (the function is only called if the request is successful)

這篇關(guān)于使用 php 和 jquery 的簡(jiǎn)單彗星示例的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個(gè)表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動(dòng)填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱(chēng) ASC)
主站蜘蛛池模板: 亚洲电影一区 | 国产欧美在线播放 | 精品久久精品 | 欧美成人在线免费 | 欧美大片久久久 | 羞羞视频网页 | 国产精品免费一区二区三区 | 亚洲精品高清视频在线观看 | 午夜视频网 | 成人在线免费视频观看 | 91精品一区二区三区久久久久 | 日韩午夜| 精品久久久久久亚洲国产800 | 在线视频三区 | 国产欧美精品一区 | 久久91精品国产一区二区三区 | 亚洲高清视频在线 | 午夜精品久久久久久久久久久久 | avmans最新导航地址 | 国产一级电影网 | 欧美人成在线视频 | 国产精品18久久久久久久 | 精品国产乱码久久久久久蜜柚 | 91福利网| 成人国产在线视频 | 狠狠爱综合 | 日韩欧美1区2区 | 一本色道久久综合亚洲精品高清 | 国产熟熟 | 国产日韩精品一区二区 | 免费观看黄色一级片 | 日韩有码一区二区三区 | 国产精品海角社区在线观看 | 毛片大全| 欧美性生交大片免费 | 久草.com| 国产精品99久久久久久久久久久久 | 激情久久av一区av二区av三区 | 日韩精品在线播放 | 老外黄色一级片 | 国产精品爱久久久久久久 |