Skip to main content

Posts

Showing posts with the label call ajax request in angularjs

What Is RequireJS?

What is RequireJS? ü    RequireJS is a JavaScript library and AMD compatible asynchronous module loader. ü    RequireJS is used to loads the JavaScript files and resolve their dependencies and its supported to the latest versions of popular browsers. ü    RequireJS helps to improve the performance and code of quality. ü    RequireJS was developed by David Mark. Its open source and it was released in 2009. ü    RequireJS is used by node.js to fetch and load module. ü    RequireJS contains a small set of plugins which allow us to loading the various types of resources like text, Dom Ready, i18n, CSS and loading. RequireJS includes three main API functions  - ü    Define  () - This function is used to define a module. Each module is defined a unique module ID. This module Id is used by RequireJS at the runtime. ü    Require  () - This function is used to load dependencies a...

2 Powerful Ways to Call Ajax Sync and Asyn Request [AJAX]

“ How do you use AJAX”?   “ How to call Synchronous and Asynchronous Requests”? The AJAX stands for “ Asynchronous JavaScript and XML ” and " AJAX " is a technique to creating interactive web applications and allows us to send and receive data asynchronously without refreshing the web page. more.. Example for calling “Synchronous” and “Asynchronous” Requests! //AJAX Synchronous and Asynchronous Requests. //#REGION NAMESPACE var demo = demo || {}; //#ENDREGION demo.ajax = demo.ajax || ( function () { var getBaseURL = function () { var currentBaseURL = location.protocol + "//" + location.hostname + (location.port && ":" + location.port) + "/" ; return currentBaseURL; }; var baseURL = getBaseURL(); var request_token; var ajaxAsyncCall = function (requestURL, typeGP, inputs, request_token) { $.ajax({ url : requestURL, ...

jQuery Ajax error handling, show custom exception messages

Hello Guys, I am going to share the global error handling in the jQuery Ajax and trying to cover all the errors displays. The detail you can see in the example,  //jQuery global error handling Ajax. //#region NAMESPACE var demo = demo || {}; //#endregion //#region VARIABLES USED IN THIS JS var obj_hdrs = []; var obj = new Object(); //#endregion //#region GLOBAL CONTEXT demo.baseConst = { baseUrl: getBaseURL(), contentType: "application/json; charset=utf-8" , dataType: "json" , statusErrors : { 'M400' : "Server understood the request, but request content was invalid. [400]" , 'M401' : "Unauthorized access. [401]" , 'M403' : "Forbidden resource can not be accessed. [403]" , 'M404' : "Requested page not found. [404]" , 'M500' : "Internal server error. [500]" , 'M503' : "Service u...

jQuery AJAX - Synchronous Request

The Synchronous  Request blocks the client DOM / browser until your operations is completed. It is basically hold and wait process. The second process will execute after first one is completed and when a synchronous call occurred that time the DOM/browser both are blocked. A Synchronous call opens a socket and waits for a response before closing the socket. The operations (send, receive, and reply) will be Synchronous or Asynchronous. The every blocking operation is not synchronous operations and it may be other operations. By default, the $.ajax request in jQuery is set to asynchronous and we can set ( async : false ) for synchronous operations otherwise ( async : true ). For Asynchronous request click... Example – AJAX Synchronous Call //AJAX Synchronous and Asynchronous Requests. //#REGION NAMESPACE var demo = demo || {}; //#ENDREGION demo.ajax = demo.ajax || ( function () { var getBaseURL = function () { var c...

AJAX - XMLHttpRequest Object

The XMLHttpRequest object is an API that is used to transferring data between a web browser and a web server using HTTP protocol and also provides the connection between a client and server. The object is provided by the browsers scripting languages looks like JavaScript, JScript, and other environments. It is also known as short name “ XHR ”. The concept behind the XMLHttpRequest object was originally created by Microsoft . The XMLHttpRequest property looks like, a)       onreadystatechange b)      responseText c)       responseXML d)      status e)       statusText f)        readyState : the readyState can be 0, 1, 2, 3 and 4.                              ...

What is AJAX (Asynchronous JavaScript and XML)?

What is AJAX? The AJAX stands for “ Asynchronous JavaScript and XML ” and AJAX is a technique to creating interactive web applications and allows us to send and receive data asynchronously without refreshing the web page. The XMLHttpRequest object is part of a technology called AJAX . AJAX is very faster and easy, we can implement AJAX in a meaningful manner. It is a group of related technologies looks like, a)       HTML/XHTML and CSS b)      DOM c)       XML or JSON d)      XMLHttpRequest e)       JavaScript The AJAX was popular in 2005 by Google , with Google Suggest . Where it is used? The AJAX technology used by a)       Google, b)      Facebook, c)       Twitter etc. I hope it is helpful to you! Thank you!

How to call AJAX Request in AngularJs?

I am going to share the code sample for the ways of calling AJAX Request using $http.get(), $http.post(),  $http.put(),  $http.post(),  $http. delete() or  $http.head()  methods in angularjs. Table of Content   $http  service   $http function   $http as a function   The config parameter   The success() And error() functions in angularjs Ajax The angularjs  AJAX R equest manage in different types. The types re given below. AJAX call over the $http services. REST API Call over the $http services. JSON Call over the $http services. The $http services is a way of sending AJAX request on the web servers.  The $http and $scope both are managed by the controller function. The functions over the $http service that is called $http function. The function list as given below. $http.get(url, config); $http.post(url, data, config); $http.put(url, data, config); $http.delete(url, config); $http....