The JavaScript Fetch API helps users create asynchronous HTTP requests. Fetch API is an easy and intuitive method for sending HTTP requests in a web browser where the content type is typically application json. For a web-application whose XMLHttpRequest (XHR) object is available for downloading, fetch will perform any task as XHR objects will. The fetch API is further simplified and easier to use. Using the Promise system gives more flexibility to the request using to servers by the internet browser. This fetch() function has a global scope which instructs the browser to redirect a request to the web.
Category: AJAX
-
Understand JavaScript Events with Examples
JavaScript has many built-in functions that allow you to create custom events. In this article, we’ll take a look at some of these functions and see what they do.
-
No Access-Control-Allow-Origin header is present on the requested resource
Are you confused why you are getting this error? This error is caused when you are trying to perform an AJAX call from one site to a different site. Because Javascript is a client-side application it requires additional security to help protect the users from malicious code, e.g. calling a different site without the user knowing.
-
Using the JsHelper in CakePHP to submit a form with AJAX
The JsHelper in CakePHP 2.x has replaced the AjaxHelper from CakePHP 1.x. I recently tried to implement the JsHelper without very much success; perhaps if I would have read the documentation more closely it would have been quite obvious what my mistake was. So in case you’re like me and often skim over long documentation of a helper when you just need one function, in my case: $this->Js->submit() then you can often miss very important information. This article will hopefully help clarify
it. If you want to further enhance some stuff I highly recommend Organizing data with the jQuery Sortable plugin. -
Transitioning AJAX Content into view with CSS3 Animations
In a previous article, I demonstrated how you can use jQuery to Transition AJAX Content into view with $.animate(). In this article, we are going to remove the jQuery animation and use CSS3 instead.