jQuery的load()方法及其回調函數用法示例

學識都 人氣:2.44W

本文實例講述了jQuery的load()方法及其回調函數用法。分享給大家供大家參考。具體如下:

jQuery的load()方法及其回調函數用法示例

下面的js代碼演示了jQuery的load()方法的`使用,並演示了帶回調函數(callback)的load方法的使用

$(document)y(function(){ $("button")k(function(){ $("#div1")("demo_",function(responseTxt,statusTxt,xhr){ if(statusTxt=="success") alert("External content loaded successfully!"); if(statusTxt=="error") alert("Error: "+us+": "+usText); }); });});

Let jQuery AJAX Change This Text

Get External Content