Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

what is ajax

Ajax is a set of web development techniques
that uses various web technologies on the 
client-side to create asynchronous web 
applications.
Comment

ajax

With Ajax, web applications can send and retrieve data from a server asynchronously without interfering with the display and behaviour of the existing page.
Comment

ajax

AJAX - Asynchronous JavaScript And XML
Comment

ajax

var xhr = new XMLHttpRequest;
var url = "/?lorem=ipsum";

//GET request
xhr.open('GET', url); //Open the request with the specified url.
xhr.onreadystatechange = () => {
  //Checking if the request has finished and if it was successfull  
  if (xhr.readyState == 4 && xhr.status == 200) {
        console.log(xhr.responseText); //Printing out the response. 
    	//You can also use xhr.responseXML
    }
}
xhr.send(); //This sends the request to the server with the specified params.
Comment

ajax

$.ajax({
        method :'GET',
        url: baseUrl+'ajaxcontroller/LoadData_To_View',
        success:function(data){
        $('#item').html(data);
        alert(data);
        },
        complete: function(){
        $('#loadingImage2').hide();
        },
        error:function (xhr, ajaxOptions, thrownError){alert(thrownError);}
        });
Comment

ajax

        var value = $("#quicksearchtext").val();
        
        var model =
        {
            industryCode : value
        }

        $.ajax({
            url: "/Setting/GetSubIndustryList",
            type: "POST",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            async: false,
            data: JSON.stringify(model),
            success: function (res) {
                console.log('doGetBeamSubIndustry success');
                $("#txtBusinessSubIndustry").find('option').remove();

                $.each(res.message, function (index, value) {
                    $("#txtBusinessSubIndustry").append("<option value=" + value.code + ">" + value.names.en + "</option>");
                });

            },
            error: function (jqXHR, exception) {
                console.log('doGetBeamSubIndustry error');
                console.log(jqXHR.responseText);
            }
        });
Comment

ajax

$.ajax({
    url: 'some_unknown_page.html',
    success: function (response) {
        $('#post').html(response.responseText);
    },
    error: function (jqXHR, exception) {
        var msg = '';
        if (jqXHR.status === 0) {
            msg = 'Not connect.
 Verify Network.';
        } else if (jqXHR.status == 404) {
            msg = 'Requested page not found. [404]';
        } else if (jqXHR.status == 500) {
            msg = 'Internal Server Error [500].';
        } else if (exception === 'parsererror') {
            msg = 'Requested JSON parse failed.';
        } else if (exception === 'timeout') {
            msg = 'Time out error.';
        } else if (exception === 'abort') {
            msg = 'Ajax request aborted.';
        } else {
            msg = 'Uncaught Error.
' + jqXHR.responseText;
        }
        $('#post').html(msg);
    },
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: add update react pwa feature 
Javascript :: How to append the string to the current url in jquery | Javascript 
Javascript :: how to make a field not required with joi 
Javascript :: js method .sort 
Javascript :: arguments object in javascript 
Javascript :: formgroup angular 
Javascript :: make service singleton angular 
Javascript :: axios put request 
Javascript :: appendchild element once if element present in js 
Javascript :: redirect using expressjs 
Javascript :: js add fields to map 
Javascript :: customize function (doc) datatable printable 
Javascript :: regex javascript online 
Javascript :: convert string with dot or comma as decimal separator to number in javascript 
Javascript :: webpack dev server 
Javascript :: remove last tag in dom javascript 
Javascript :: joi validate 
Javascript :: write hello world in javaskript 
Javascript :: email valid javascript 
Javascript :: simple nodejs server 
Javascript :: array.length in mongoose query 
Javascript :: how to search and filter js 
Javascript :: postgresql jsonb remove key 
Javascript :: javascript rest 
Javascript :: javascript sleep one second 
Javascript :: convert string to boolean in javascript 
Javascript :: join on JSON field 
Javascript :: javascript copy clipboard 
Javascript :: delete method 
Javascript :: js to find value in array 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =