본문 바로가기

프로그램&DB

jQuery AJAX load() Method jQuery AJAX load() Method jQuery AJAX Methods Example Change the text of a div element using an AJAX request: $("button").click(function(){ $("div").load('demo_ajax_load.txt'); }); Try it yourself » Definition and Usage The load() method loads data from a server using an AJAX request, and places the returned data into the specified element. Note: There is also a jQuery Event method called load. .. 더보기
jQuery AJAX $.getScript() Method jQuery AJAX getScript() Method jQuery AJAX Methods Example Get and run a JavaScript using an AJAX request: $("button").click(function(){ $.getScript("demo_ajax_script.js"); }); Try it yourself » Definition and Usage The getScript() method is used to get and execute a JavaScript using an AJAX HTTP GET request. Syntax $(selector).getScript(url,success(response,status)) Parameter Description url Re.. 더보기
jQuery AJAX $.getJSON() Method jQuery AJAX getJSON() Method jQuery AJAX Methods Example Get JSON data using an AJAX request, and output the result: $("button").click(function(){ $.getJSON("demo_ajax_json.js",function(result){ $.each(result, function(i, field){ $("div").append(field + " "); }); }); }); Try it yourself » Definition and Usage The getJSON() method is used to get JSON data using an AJAX HTTP GET request. Syntax $(.. 더보기
jQuery AJAX $.get() Method jQuery AJAX get() Method jQuery AJAX Methods Example Change the text of a div element using an AJAX GET request: $("button").click(function(){ $.get("demo_ajax_load.txt", function(result){ $("div").html(result); }); }); Try it yourself » Definition and Usage The get() method is used to perform an AJAX HTTP GET request. Syntax $(selector).get(url,data,success(response,status,xhr),dataType) Parame.. 더보기
jQuery AJAX ajaxSuccess() Method jQuery AJAX ajaxSuccess() Method jQuery AJAX Methods Example Trigger an alert box when an AJAX request completes successfully: $("div").ajaxSuccess(function(){ alert("AJAX request successfully completed"); }); Try it yourself » Definition and Usage The ajaxSuccess() method specifies a function to be run when an AJAX request is successfully completed. Syntax $(selector).ajaxSuccess(function(event.. 더보기
jQuery AJAX ajaxStop() Method jQuery AJAX ajaxStop() Method jQuery AJAX Methods Example Trigger an alert box when all AJAX requests have completed: $("div").ajaxStop(function(){ alert("All AJAX requests completed"); }); Try it yourself » Definition and Usage The ajaxStop() method specifies a function to run when ALL AJAX requests have completed. When an AJAX request completes, jQuery checks if there are any more AJAX request.. 더보기
jQuery AJAX ajaxStart() Method jQuery AJAX ajaxStart() Method jQuery AJAX Methods Example Show a "loading" indicator image when an AJAX request starts: $("div").ajaxStart(function(){ $(this).html(""); }); Try it yourself » Definition and Usage The ajaxStart() method specifies a function to be run when an AJAX request starts. Syntax $(selector).ajaxStart(function()) Parameter Description function() Required. Specifies the func.. 더보기
jQuery AJAX $.ajaxSetup() Method jQuery AJAX ajaxSetup() Method jQuery AJAX Methods Example Set the default URL and success function for all AJAX requests: $("button").click(function(){ $.ajaxSetup({url:"demo_ajax_load.txt",success:function(result){ $("div").html(result);}}); $.ajax(); }); Try it yourself » Definition and Usage The ajaxSetup() method sets default values for future AJAX requests. Syntax $.ajaxSetup({name:value, .. 더보기