jQuery ကျူတိုရီရယ်

jQuery ပင်မစာမျက်နှာ jQuery မိတ်ဆက် jQuery စတင်လိုက်ပါ။ jQuery Syntax jQuery ရွေးချယ်မှုများ jQuery ပွဲများ

jQuery အကျိုးသက်ရောက်မှုများ

jQuery ဖျောက်/ပြပါ။ jQuery အရောင်မှိန်ခြင်း။ jQuery Slide jQuery Animate jQuery stop() jQuery ပြန်ခေါ်ပါ။ jQuery ချိတ်ဆက်ခြင်း။

jQuery HTML

jQuery ကိုရယူပါ။ jQuery သတ်မှတ် jQuery ကိုထည့်ပါ။ jQuery ကိုဖယ်ရှားပါ။ jQuery CSS အတန်းများ jQuery css() jQuery အတိုင်းအတာများ

jQuery လမ်းလျှောက်ခြင်း။

jQuery လမ်းလျှောက်ခြင်း။ jQuery ဘိုးဘေးများ jQuery မျိုးဆက်များ jQuery မောင်နှမများ jQuery စစ်ထုတ်ခြင်း။

jQuery AJAX

jQuery AJAX နိဒါန်း jQuery Load jQuery Get/Post

jQuery ထွေ

jQuery noConflict() jQuery စစ်ထုတ်မှုများ

jQuery ဥပမာများ

jQuery ဥပမာများ jQuery စာမေးပွဲ jQuery လေ့ကျင့်ခန်းများ jQuery လက်မှတ်

jQuery ကိုးကားချက်များ

jQuery ခြုံငုံသုံးသပ်ချက် jQuery ရွေးချယ်မှုများ jQuery ပွဲများ jQuery အကျိုးသက်ရောက်မှုများ jQuery HTML/CSS jQuery လမ်းလျှောက်ခြင်း။ jQuery AJAX jQuery ထွေ jQuery ဂုဏ်သတ္တိများ

jQuery ajax() နည်းလမ်း

❮ jQuery AJAX နည်းလမ်းများ

ဥပမာ

AJAX တောင်းဆိုမှုကို အသုံးပြု၍ <div> ဒြပ်စင်တစ်ခု၏ စာသားကို ပြောင်းပါ-

$("button").click(function(){
  $.ajax({url: "demo_test.txt", success: function(result){
    $("#div1").html(result);
  }});
});

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

ajax() နည်းလမ်းကို AJAX (asynchronous HTTP) တောင်းဆိုမှုကို လုပ်ဆောင်ရန် အသုံးပြုသည်။

jQuery AJAX နည်းလမ်းအားလုံးသည် ajax() နည်းလမ်းကို အသုံးပြုသည်။ ဤနည်းလမ်းကို အခြားနည်းလမ်းများကို အသုံးမပြုနိုင်သော တောင်းဆိုမှုများအတွက် အများဆုံးအသုံးပြုသည်။


အထားအသို

$.ajax({name:value, name:value, ... })

ကန့်သတ်ချက်များသည် AJAX တောင်းဆိုမှုအတွက် တစ်ခု သို့မဟုတ် တစ်ခုထက်ပိုသော အမည်/တန်ဖိုးအတွဲများကို သတ်မှတ်ပေးသည်။

အောက်ပါဇယားရှိ ဖြစ်နိုင်သော အမည်/တန်ဖိုးများ-

Name Value/Description
async A Boolean value indicating whether the request should be handled asynchronous or not. Default is true
beforeSend(xhr) A function to run before the request is sent
cache A Boolean value indicating whether the browser should cache the requested pages. Default is true
complete(xhr,status) A function to run when the request is finished (after success and error functions)
contentType The content type used when sending data to the server. Default is: "application/x-www-form-urlencoded"
context Specifies the "this" value for all AJAX related callback functions
data Specifies data to be sent to the server
dataFilter(data,type) A function used to handle the raw response data of the XMLHttpRequest
dataType The data type expected of the server response.
error(xhr,status,error) A function to run if the request fails.
global A Boolean value specifying whether or not to trigger global AJAX event handles for the request. Default is true
ifModified A Boolean value specifying whether a request is only successful if the response has changed since the last request. Default is: false.
jsonp A string overriding the callback function in a jsonp request
jsonpCallback Specifies a name for the callback function in a jsonp request
password Specifies a password to be used in an HTTP access authentication request.
processData A Boolean value specifying whether or not data sent with the request should be transformed into a query string. Default is true
scriptCharset Specifies the charset for the request
success(result,status,xhr) A function to be run when the request succeeds
timeout The local timeout (in milliseconds) for the request
traditional A Boolean value specifying whether or not to use the traditional style of param serialization
type Specifies the type of request. (GET or POST)
url Specifies the URL to send the request to. Default is the current page
username Specifies a username to be used in an HTTP access authentication request
xhr A function used for creating the XMLHttpRequest object

သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ


တစ်ပြိုင်နက်တည်း တောင်းဆိုမှုကို သတ်မှတ်ရန် အက်ဆစ်ခ်ဆက်တင်ကို အသုံးပြုပါ


အတွက် ဒေတာအမျိုးအစားကို သတ်မှတ်ရန် dataType ဆက်တင်ကို အသုံးပြုပုံ။


နှင့် ကိုင်တွယ်ဖြေရှင်းရန် အမှားအယွင်းဆက်တင်ကို အသုံးပြုနည်း AJAX တောင်းဆိုချက်တစ်ခု ပြုလုပ်ပါ။


❮ jQuery AJAX နည်းလမ်းများ