AJAX and XMLHttpRequest Object

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • AJAX stands for Asynchronous JavaScript And XML.
    AJAX is not a programming language, but it is a set of existing web technologies.
    AJAX helps in fetching data asynchronously from a remote web server.
    When the data is loaded by AJAX, it is loaded asynchronously without page reload / refresh.
    Modern websites uses JSON format instead of XML for data transfer.
    In this lecture let's understand What is AJAX and how to make an AJAX call from our JavaScript code using XMLHttpRequest object.
    HTTP Status codes: www.restapitut...

Комментарии • 23

  • @ShraddhaShirke-jy6qu
    @ShraddhaShirke-jy6qu 11 месяцев назад

    Very helpful video, Thanks for this video sir, now I completely understand Ajax and XMLHttpRequest Object

  • @vamshikrishnareddy2313
    @vamshikrishnareddy2313 2 года назад +2

    beautiful explanation sir, reach++++++++++++++++++

  • @sona4612
    @sona4612 Год назад

    Thank you sir 🔥🔥🔥🔥

  • @Amit-jb5xt
    @Amit-jb5xt 3 года назад +1

    Quality content

  • @harbhajansingh9882
    @harbhajansingh9882 2 года назад

    Thank you sir for explanation 👍

  • @omfg38
    @omfg38 3 года назад

    Well done, thanks.

    • @procademy
      @procademy  3 года назад

      Please share this channel with others if you like my videos...🤝🤝

  • @thimothy1213
    @thimothy1213 2 года назад

    let b = new XMLHttpRequest();
    b.open("GET","data.txt",true);
    b.send();
    console.log(b.responseText);
    Why the above code not working..?

    • @procademy
      @procademy  2 года назад

      Have you checked the console?? Is there any error?? Are you getting any CORS related error?

    • @thimothy1213
      @thimothy1213 2 года назад

      @@procademy no error... simply a blanck page.

    • @tanjirokamado2458
      @tanjirokamado2458 2 года назад

      same for me too it doesn't update my div(i've ensured ids are correct)

    • @tanjirokamado2458
      @tanjirokamado2458 2 года назад

      @@thimothy1213 i've cleared my browser history and it worked

  • @universal4334
    @universal4334 3 года назад

    Sir onprogress isn't a method...do we need to pass a function to it ?

    • @procademy
      @procademy  3 года назад

      Onprogress is an event....and to this event, we can assign a function which will get executed when loading data is in progress

    • @procademy
      @procademy  3 года назад

      If this answer doesn't help....then please be more specific about the question. I will try to answer more precisely.

    • @universal4334
      @universal4334 3 года назад

      @@procademy actually you have assigned a object xhr to XMLHT.... Class and called it's methods in the first three cases, but when it comes to on progress you called it as a method like xhr.onprogress, but instead of passing a function into its paranthesis you assied an anonymous function that's where I confused it is a method of xmlhttp.... Class right so we need to use it like xhr.onprogress(fun(){}).
      Second;
      ok if it's a event then wee need to use it in the params of event listener right ?like variable.addeventlistener('xhr.onprogress',func(){}.. hope you get my doubt if possible could you clear it

    • @procademy
      @procademy  3 года назад

      That's right. We can also use it like xhr.onprogress(function() {.....}). So, we can pass a callback function to onprogress method. This is one approach
      And if you have seen my previous lectures on events, in one of the lectures i have covered that, it is also possible to add an event as a property to a JavaScript object, and to that property, we can assign a function or any JavaScript expression and that function or JavaScript expression will get executed when that event happens. I have used this approach in the example.
      Hope this helped. Following is the link for video lecture where i have explained event handler properties.
      ruclips.net/video/zprKTWGM4Ek/видео.html
      Feel free to ask questions unless your doubt is cleared :)

    • @universal4334
      @universal4334 7 месяцев назад

      Could you provide your mail id please

  • @angelcorona9196
    @angelcorona9196 Год назад

    proramming

  • @salexkorsan8790
    @salexkorsan8790 Год назад

    is there any way to get Outside result of the Function
    xmlhttp.onreadystatechange=function(){
    if(this.readyState==4 && this.status==200){
    var Xs=this.responseText;
    }}
    i want OutPut Result here, Out Side of the Function.
    trying to solve from two month, Please Help