Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery ajax get response code

$.ajax({
    //...        
    success: function(data, textStatus, xhr) {
        console.log(xhr.status);
    },
    complete: function(xhr, textStatus) {
        console.log(xhr.status);
    } 
});
Comment

ajax get html response

//your jquery code will be like this:
$.ajax({
      type: 'POST',
      url: $url,
      data: new FormData(this),
      dataType: 'json',
      contentType: false,
      processData:false,//this is a must
      success: function(response){ 
      		$('your_selector').html(response);
      }
});

//php code will be like this
echo '<div>some html code</div>';
die();
Comment

PREVIOUS NEXT
Code Example
Javascript :: vuejs bootsrap modal hidden event 
Javascript :: xmlhttprequest javascript 
Javascript :: react native tab.screen hide title 
Javascript :: js C:fakepath 
Javascript :: javascript change input value event 
Javascript :: vuejs get the url params withour router 
Javascript :: how to declare a variable inside a class in javascript 
Javascript :: jquery get padding of element 
Javascript :: check if the document is ready js 
Javascript :: dictionary in javascript 
Javascript :: google maps js remove google maps logo 
Javascript :: vowel array 
Javascript :: export apk react native 
Javascript :: retunr empty new promise 
Javascript :: js window location relative path 
Javascript :: vue 3 computed 
Javascript :: angular set content type 
Javascript :: generating random number in javascript 
Javascript :: How to hthe amount of users online in discordjs 
Javascript :: convert number to word js crore/lakh format 
Javascript :: get name of class javascript 
Javascript :: javascript array add end 
Javascript :: sortby vue 
Javascript :: regular expression for thousand separator 
Javascript :: how to sort an array of objects by two fields in javascript 
Javascript :: html table to excel javascript 
Javascript :: How to lock Orientation for a particular screen in ios in react native 
Javascript :: why is my req.body empty 
Javascript :: datatable order number 
Javascript :: Check if user logged in Wordpress through JS 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =