how to update the page without refresh

后端 未结 4 1457
旧巷少年郎
旧巷少年郎 2021-01-17 04:22

In Gmail when a new email is received, the page automaticly show the mail without refreshing, how this can be done?

4条回答
  •  心在旅途
    2021-01-17 05:06

    It's done by using ajax. Coincidentally, the question was tagged "ajax".

    From wikipedia: http://en.wikipedia.org/wiki/Ajax_(programming)

    "Ajax (pronounced /ˈeɪdʒæks/; shorthand for Asynchronous JavaScript and XML)[1] is a group of interrelated web development methods used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not needed, and the requests need not be asynchronous.[2]"

提交回复
热议问题