<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://178.140.10.58:8080/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://178.140.10.58:8080/feed.php">
        <title>Библиотека знаний - java-script:jquery:ajax</title>
        <description>Заметки IT программиста</description>
        <link>http://178.140.10.58:8080/</link>
        <image rdf:resource="http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-17T14:25:05+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=java-script:jquery:ajax:remoteurl"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Библиотека знаний</title>
        <link>http://178.140.10.58:8080/</link>
        <url>http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=java-script:jquery:ajax:remoteurl">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-22T22:32:02+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>jquery ajax to retrieve JSON data from remote URL</title>
        <link>http://178.140.10.58:8080/doku.php?id=java-script:jquery:ajax:remoteurl</link>
        <description>&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=tag:jquery&amp;amp;do=showtag&amp;amp;tag=jquery&quot; class=&quot;wikilink1&quot; title=&quot;tag:jquery&quot; rel=&quot;tag&quot;&gt;jquery&lt;/a&gt;,
	&lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=tag:java-script&amp;amp;do=showtag&amp;amp;tag=java-script&quot; class=&quot;wikilink1&quot; title=&quot;tag:java-script&quot; rel=&quot;tag&quot;&gt;java-script&lt;/a&gt;,
	&lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=tag:plugins&amp;amp;do=showtag&amp;amp;tag=plugins&quot; class=&quot;wikilink1&quot; title=&quot;tag:plugins&quot; rel=&quot;tag&quot;&gt;plugins&lt;/a&gt;,
	&lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=tag:bootstrap&amp;amp;do=showtag&amp;amp;tag=bootstrap&quot; class=&quot;wikilink1&quot; title=&quot;tag:bootstrap&quot; rel=&quot;tag&quot;&gt;bootstrap&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;h1 class=&quot;sectionedit1&quot; id=&quot;jquery_ajax_to_retrieve_json_data_from_remote_url&quot;&gt;jquery ajax to retrieve JSON data from remote URL&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;jquery ajax to retrieve JSON data from remote URL&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;jquery_ajax_to_retrieve_json_data_from_remote_url&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;47-111&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;section1&quot;&gt;1&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;strong&gt;test.json&lt;/strong&gt;
&lt;/p&gt;
&lt;pre class=&quot;code html4strict&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
function getJSON(json) {
    alert(&amp;quot;Got JSON!&amp;quot;);
    // do something with json
}
&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;http://192.168.99.68/test.json?callback=getJSON&amp;quot;&lt;/span&gt; async&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;1&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;section1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;112-392&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;section2&quot;&gt;2&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code html4strict&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;div&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;images&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;div&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code php&quot;&gt;$&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;getJSON&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    tags&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;gulmarg&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
    tagmode&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;any&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
    format&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;json&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;data&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    $&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;a href=&quot;http://www.php.net/each&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;each&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;data&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;items&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;item&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;img/&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;attr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;src&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; item&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;media&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;m&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;appendTo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;#images&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;section2&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;393-799&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;section3&quot;&gt;3&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code php&quot;&gt;$&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;jsonp&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;url&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; target_url&lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;ping.php?callback=?&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;success&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;data&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// print out data&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;error&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;d&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;msg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// error&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code php&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;&amp;lt;?php&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;&#039;callback&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;(&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;{&#039;response&#039; : &#039;success&#039;}&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;)&#039;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;sy1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;a href=&quot;https://github.com/jaubourg/jquery-jsonp&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/jaubourg/jquery-jsonp&quot; rel=&quot;ugc nofollow&quot;&gt;https://github.com/jaubourg/jquery-jsonp&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;3&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;section3&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;800-&amp;quot;} --&gt;</description>
    </item>
</rdf:RDF>
