From 3d084324a211c06354b173c607e7aab50a6477ac Mon Sep 17 00:00:00 2001 From: Rani K Date: Sun, 27 Oct 2019 00:53:25 -0700 Subject: [PATCH 1/3] Added get example Added a `.get` example to show how to request a different page from the same domain. Noticed all the examples on this page were for appending to the current url rather than changing the url to another page on the same domain. May be helpful for some people. --- entries/jQuery.get.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index be1e25a2..b6de7d4f 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -116,13 +116,24 @@ $.get( "test.cgi", { name: "John", time: "2pm" } ) ]]> - Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + + + Get another page on the same domain. Outputs to console both the data returned and the type of data returned. + From f936379583aec2117d44e6eae6c10c041efaf5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Tue, 11 Aug 2020 20:53:50 +0200 Subject: [PATCH 2/3] Update entries/jQuery.get.xml --- entries/jQuery.get.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index b6de7d4f..7a9d37e7 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -131,7 +131,7 @@ $.get( "test.php", function( data ) { // If this was sent on https://api.jquery.com/jQuery.get/ you will // get the response result of https://api.jquery.com/jQuery.ajax/ $.get( "/jQuery.ajax/", function( data ) { - console.log( typeof( data ) ); + console.log( typeof data ); console.log( data ); }); ]]> From e4a5bfc9362dbd035e7666e32f72b56d15651669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Tue, 11 Aug 2020 20:55:48 +0200 Subject: [PATCH 3/3] Update entries/jQuery.get.xml --- entries/jQuery.get.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 7a9d37e7..96dc1f08 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -131,8 +131,8 @@ $.get( "test.php", function( data ) { // If this was sent on https://api.jquery.com/jQuery.get/ you will // get the response result of https://api.jquery.com/jQuery.ajax/ $.get( "/jQuery.ajax/", function( data ) { - console.log( typeof data ); - console.log( data ); + console.log( typeof data ); // string + console.log( data ); // HTML content of the jQuery.ajax page }); ]]>