<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Query arcgis web service with $.ajax (jquery) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244456#M22631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does any one know how to query a arcgis web service json format with jquery $.ajax ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was thinking using something like this in order to test if it returns data :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]$(document).ready(function(){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; $.ajax( {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; type:'Get',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; url:'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://xxx/yyy/rest/services/ppp/rrrr/MapServer/1/28?f=json" rel="nofollow" target="_blank"&gt;http://xxx/yyy/rest/services/ppp/rrrr/MapServer/1/28?f=json&lt;/A&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; datatype: "jsonp",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; success:function(data) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; alert(data);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; })&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;});[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When trying the url in a browser the json is return... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Nov 2012 18:13:16 GMT</pubDate>
    <dc:creator>EricLussier</dc:creator>
    <dc:date>2012-11-27T18:13:16Z</dc:date>
    <item>
      <title>Query arcgis web service with $.ajax (jquery)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244456#M22631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does any one know how to query a arcgis web service json format with jquery $.ajax ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was thinking using something like this in order to test if it returns data :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]$(document).ready(function(){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; $.ajax( {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; type:'Get',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; url:'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://xxx/yyy/rest/services/ppp/rrrr/MapServer/1/28?f=json" rel="nofollow" target="_blank"&gt;http://xxx/yyy/rest/services/ppp/rrrr/MapServer/1/28?f=json&lt;/A&gt;&lt;SPAN&gt;',&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; datatype: "jsonp",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; success:function(data) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; alert(data);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; })&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;});[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When trying the url in a browser the json is return... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 18:13:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244456#M22631</guid>
      <dc:creator>EricLussier</dc:creator>
      <dc:date>2012-11-27T18:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Query arcgis web service with $.ajax (jquery)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244457#M22632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To have ArcGIS Server return JSONP, add a query string parameter named "callback". Here's an example using $.ajax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
$.ajax({
&amp;nbsp; url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query",
&amp;nbsp; data: { f: "json", where: "1=1", returnGeometry: false },
&amp;nbsp; dataType: "jsonp",
&amp;nbsp; &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;jsonpCallback: "callback"&lt;/SPAN&gt;,
&amp;nbsp; success: function(response) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("got response: ", response);
&amp;nbsp; }
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But more importantly, why do this instead of using a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/querytask.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;queryTask&lt;/A&gt;&lt;SPAN&gt; from the API? Or is your app not using the JS API? If that's the case, the best place for a question like this is the &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/forums/214-ArcGIS-10.1-for-Server-General" rel="nofollow noopener noreferrer" target="_blank"&gt;AGS general forum&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:12:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244457#M22632</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T12:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Query arcgis web service with $.ajax (jquery)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244458#M22633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I'm want to experiment with JQuery is from my understanding when using querytask you ended fetching&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you results in a datatable or dgrid and because I have to deal with wcag 2.0 (accessibility standard). datagrid or dgrid are not compliant with wcag 2.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use querytask can I fetch the query result is table generated with JQuery?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 22:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244458#M22633</guid>
      <dc:creator>EricLussier</dc:creator>
      <dc:date>2012-11-27T22:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query arcgis web service with $.ajax (jquery)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244459#M22634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;The reason I'm want to experiment with JQuery is from my understanding when using querytask you ended fetching&lt;BR /&gt;you results in a datatable or dgrid and because I have to deal with wcag 2.0 (accessibility standard). datagrid or dgrid are not compliant with wcag 2.0.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Using a queryTask retrieves features from a service, it doesn't do anything to display them for you. We publish samples showing how to take the results of a queryTask and display them in various ways but ultimately it's up to the developer to decide how to display features retrieved using a queryTask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;If I use querytask can I fetch the query result is table generated with JQuery?&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you asking to take the results of a queryTask and generate a table to display them using jQuery? If so, that's possible, but it'll be up to you to code it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to re-iterate, the queryTask fetches features for you. Think of it like an xhrGet or JSONP style request??? it gets some data but how that data ends up being displayed is up to you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 23:14:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244459#M22634</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-11-27T23:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Query arcgis web service with $.ajax (jquery)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244460#M22635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try with querytask as you proposed and see how it work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 10:59:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-arcgis-web-service-with-ajax-jquery/m-p/244460#M22635</guid>
      <dc:creator>EricLussier</dc:creator>
      <dc:date>2012-11-28T10:59:36Z</dc:date>
    </item>
  </channel>
</rss>

