JavaScript get Method
JavaScript get Method
JavaScript get method loads data from the server using a HTTP GET request.
Requesting a URL
In the following example, we provide server-side coding for both PHP and Node.js, you can choose your favorite.
Example
The following is the server-side coding using PHP.
The following is the server-side coding using Node.js.
In the following client-side coding, we are not sending any data. Instead, we request a URL using javascript GET method and receive a response.
Syntax
Parameter Values
Value | Type | Explanation |
---|---|---|
method | Required | Specifies the request type. Possible values are:
|
url | Required | Specifies the url to which the request is sent. |
async | Required | true (asynchronous) or false (synchronous). Default is true. |
user | Optional | user name for authentication in server side. |
pass | Optional | password for authentication in server side. |
Requesting a URL with Data
In the following example, we provide server-side coding for both PHP and Node.js, you can choose your favorite.
Example
The following is the server-side coding using PHP.
The following is the server-side coding using Node.js.
In the following client-side coding, we are requesting a URL with data using javascript GET method and receive a response.
Reminder
Hi Developers, we almost covered 95% of AJAX Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in AJAX.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.