jQuery API jQuery API 中英文对照版
loadIfModified(url, params, callback)
loadIfModified(url, params, callback)

当远程文件修改后,装入修改后的远程文件页请内容到DOM元素.

返回值:jQuery

参数:

  • url (String): 装入的HTML文件url地址
  • params (Map): 可选)发送到服务端的键/值对参数。
  • callback (Function): 可选) 当数据装入完成时执行的函数.

示例:

$("#feeds").loadIfModified("feeds.html");

HTML 代码:

<div id="feeds"></div>

结果:

<div id="feeds"><b>45</b> feeds found.</div>

 
loadIfModified( url, params, callback )

Load HTML from a remote file and inject it into the DOM, only if it's been modified by the server.

Return value: jQuery
Parameters:

  • url (String): The URL of the HTML file to load.
  • params (Map): (optional) Key/value pairs that will be sent to the server.
  • callback (Function): (optional) A function to be executed whenever the data is loaded (parameters: responseText, status and response itself).

Example:

 $("#feeds").loadIfModified("feeds.html");  
Before:
 <div id="feeds"></div>  
Result:
 <div id="feeds"><b>45</b> feeds found.</div>  
相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog