Archive for the ‘Ajax’ Category

Fetching Data from a Third-Party API with Vue.js and Axios

Posted on: No Comments
More often than not, when building your JavaScript application, you would want to fetch data from a remote source or consume an API. I recently looked into some publicly available APIs and found that there is lots of cool stuff that can be done with da...

Animate in Ajax’d Content to its Natural Height

Posted on: No Comments
Let's combine three things we just learned here on CSS-Tricks: One, transitioning to auto dimensions. Two, Ajaxing for stuff in a modern way. Three, waiting for images to be loaded to measure them. With all these three things in our toolbox, we can Aj...

Need to do Dependency-Free Ajax?

Posted on: No Comments
One of the big reasons to use jQuery, for a long time, was how easy it made Ajax. It has a super clean, flexible, and cross-browser compatible API for all the Ajax methods. jQuery is still mega popular, but it's becoming more and more common to ditch i...

Cache Fetched AJAX Requests Locally: Wrapping the Fetch API

Posted on: No Comments
This article demonstrates how you implement a local cache of fetched requests so that if done repeatedly it reads from session storage instead. The advantage of this is that you don't need to have custom code for each resource you want cached. Follow a...

Building Real-time Apps with Websockets & Server-Sent Events

This article was peer reviewed by Craig Bilner and Dan Prince. Thanks to all of SitePoint's peer reviewers for making SitePoint content the best it can be! An important part of writing rich internet applications is reacting to data changes. Consider th...

Sinon Tutorial: JavaScript Testing with Mocks, Spies & Stubs

Posted on: No Comments
This article was peer reviewed by Mark Brown and MarcTowler. Thanks to all of SitePoint's peer reviewers for making SitePoint content the best it can be! One of the biggest stumbling blocks when writing unit tests is what to do when you have code that'...

Look Ma, No Server: Developing Apps with Angular 2 MockBackend

Posted on: No Comments
Getting your front-end and back-end teams up to full speed is certainly something each company is looking for. Often though, what happens is that the teams fall into the pit of blocking dependencies. Those are situations where the upcoming work of one ...

An Introduction to jQuery’s Deferred Objects

Posted on: No Comments
For a long time, JavaScript developers have used callback functions to perform several tasks. A very common example is to add a callback via the addEventListener() function to execute various operations when an event, such as click or keypress, is fire...

Interactive JavaScript Charts Using Data from Google Sheets

Posted on: No Comments
Meet my friend Jenny. She recently started coding websites. She loved her job and was very happy until she met Steve, who has a reputation of being, let's say, not a very easygoing client. Steve had a lot of data in a spreadsheet and he wanted to displ...

Ajax/jQuery.getJSON Simple Example

Posted on: No Comments
In this article we'll investigate the importance of JSON and why we should use it in our applications. We'll see that jQuery has got us covered with a very nice convenience function. What is JSON? [author_more] JSON stands for JavaScript Object Notatio...