How to upload file with JavaScript and PHP

File uploading is a basic requirement in a website. It is done using a server-side script. Requires reloading the page after form submission to execute the script.

With AJAX client-side script is interact with the server-side script and performs the action without page reload.

In this tutorial, I show how you can upload file using JavaScript AJAX and PHP.

How to upload file with JavaScript and PHP

Read more

How to send GET and POST AJAX request with JavaScript

AJAX is a web de­velopment technique­ that facilitates the exchange­ of data between the­ website visible on a use­r’s browser and its server-side­ database. This enables se­amless communication for optimal performance and use­r experience­.

JavaScript libraries or frame­works are commonly utilized by people­ to conveniently transmit AJAX reque­sts. Although it’s essential to recognize­ the significance of transmitting AJAX reque­sts with plain JavaScript as well.

To communicate with the server, use an object called XMLHttpRequest. It helps in sending and receiving data between the client-side and server-side.

In this tutorial, I show how you can send GET and POST AJAX requests with JavaScript and handle the request with PHP.

How to send GET and POST AJAX request with JavaScript

Read more

Pitch volume Detection in Speech Recognition – JavaScript

Web Speech API allows recording human voice and convert it to text or generate an audio file.

This can be used to enable the users to access the website hand-free and give commands with voice.

Sometimes, requires to detect the user voice volume.

To do this I am using volume-meter.js library.

It returns pitch volume.

Use this value to draw a graphical representation.

Pitch volume Detection in Speech Recognition - JavaScript

Read more

How to prevent Browser from caching JavaScript file

Sometimes, JavaScript modification doesn’t reflect on the page while running the need to clear browser cache manually each time when the file gets updated.

It makes the debugging process hard.

If the project contains some bug and you fix it but the user needs to clear the browser cache to reflect the changes.

In this tutorial, I show how you can prevent JavaScript file from Caching by the browser.

How to prevent Browser from caching JavaScript file

Read more