Ajax Response

Send multiple data in ajax response

AJAX is an acronym for Asynchronous JavaScript and XML. It is a group of inter-related technologies like JavaScript, DOM, XML, HTML, CSS etc. AJAX allows you to send and receive data asynchronously without reloading the web page. You can use Ajax for getting data and showing it to your website without refreshing the web page.

In most condition people use to send single data in ajax response to check whether it satisfy the condition. In this post you will learn how to send multiple data in ajax response. We will use json to send and receive data where json_encode will be used to send the data from Back-End and parseJSON will be used to parse the data in Front-End.

We are taking php code as example here for Backend.

Back-End code for Json Encryption

Front-End code for Json Decryption

That’s it. Use this code to get Json response for getting multiple data to your ajax response. This code can be used on any platform.