Csaba Kissi Profile picture
Dec 13 10 tweets 4 min read
4 different ways to create an Ajax request in Javascript.
1. Using the XMLHttpRequest object:
2. Using the fetch() method:
3. Using jQuery.ajax() method (if you're still using JQuery):
4. Using an Axios library.

To create an Ajax request using Axios, you can use the axios.get() or axios.post() methods, depending on the type of request you want to make.

For example, to send a GET request, you can use the following code:
To send a POST request, you can use the axios.post() method instead:
Both of these methods accept a URL as the first argument, followed by an optional config object that allows you to specify the request method, headers, data, and other options.
You can then use the then() method to handle the response and the catch() method to handle any errors that may occur.
If you like this post, you can bookmark and tag it by replying with @SaveToBookmarks #javascript #ajax

You can view your bookmarks on savetobookmarks.com
That's all, guys.

If you found this list useful, consider:

✅ Follow @csaba_kissi for more content like this
🔔 Enable notifications 👀
🔄 Retweeting the first tweet.

Thanks for your support, guys! 🙏🤝

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Csaba Kissi

Csaba Kissi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @csaba_kissi

Dec 13
7 Low code sites web developers may feel illegal to know.

But you know what?

They can save you tens of hours every month (trust me):
{1} @appwrite

Excellent open-source Firebase alternative.

It's a secure backend server for web, mobile & flutter developers.

Out-of-the-box support for:

✅ Authentication and Users (social logins included)
✅ Functions
✅ Database
✅ Storage

👉 appwrite.io
{2} Carrd

Simple, free, fully responsive one-page sites for pretty much anything

A free platform for building simple, fully responsive one-page sites for pretty much anything.

🔗 carrd.co Image
Read 9 tweets
Dec 11
How to create a simple Express server in Nodejs 👇
First, you will need to create a project folder and then install the Express library.

To do this, open a terminal window and type:

npm install express --save
Once installed, create a file called index.js in your project folder.

This is where you'll write the code for your server.

In the index.js file, add the following code to import the Express library and start the server:
Read 8 tweets
Dec 10
How to use local storage in Javascript?

Let me show you 👇
Browser local storage is a feature of web browsers that enables websites to store data locally on the user’s computer.

This type of storage is used to store information that should persist even after the user has closed the browser.
It can also be used to store small amounts of data that needs to be available for a long period of time, even after the user has left the website.

Let me show you 4 most common methods:
Read 10 tweets
Dec 9
5 interesting APIs you can use for your next project.

Thread 🧵👇
1️⃣ TheRundown

NFL, NBA, WNBA, MLB, NHL, NCAA Football real-time odds, scores, and schedules all in one place.

rapidapi.com/therundown/api…
2️⃣ Custom QR Code with Logo

Create unique looking QR codes with logo, color and design as PNG, SVG, PDF or EPS.

QR Codes can be generated in high quality for print and professional use cases.

rapidapi.com/qrcode-monkey/…
Read 7 tweets
Dec 9
There are 5 types of loops that are commonly used in JavaScript you should know about 👇
1️⃣ For loops:

This type of loop is used to execute a block of code a specified number of times.

It has the following syntax:

for (initialization; condition; increment/decrement) {
// code to be executed
}

e.g.

for (let i = 0; i < 10; i++) {
// code to be executed
}
2️⃣ While loops:

This type of loop is used to execute a block of code while a specified condition is true.

It has the following syntax

while (condition) {
// code to be executed
}

e.g.

while (i < 10) {
// code to be executed
i++;
}
Read 10 tweets
Dec 8
The console log is more powerful than most web developers think.

See below 👇 Image
Go to stackblitz.com and log in.

Stackblitz is an online code editor (I'm not affiliated with them)

You can even use the local Javascript file to test the following.
Open a new Javascript project. Image
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(