Jquery .get

Code examples

87
0

jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
13
0

jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
8
0

jquery get

$.get( "ajax/test.html", function( data ) {
  $( ".result" ).html( data );
  alert( "Load was performed." );
});
4
0

jquery get request

jQuery get() Method
The jQuery get() method sends asynchronous http GET request to the server and retrieves the data.

Syntax:
$.get(url, [data],[callback]);
Parameters Description:

url: request url from which you want to retrieve the data
data: data to be sent to the server with the request as a query string
callback: function to be executed when request succeeds
The following example shows how to retrieve data from a text file.

Example: jQuery get() Method
$.get('/data.txt',  // url
      function (data, textStatus, jqXHR) {  // success callback
          alert('status: ' + textStatus + ', data:' + data);
    });
In the above example, first parameter is a url from which we want to retrieve the data. Here, we want to retrieve data from a txt file located at mydomain.com/data.txt. Please note that you don't need to give base address.
0
0

jquery


  <script src="https://code.jquery.com/jquery-3.4.1.js"></script>

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................