<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JSON Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/json/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/json/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:34:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>How to use JQuery AJAX Method to Call an API?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-use-jquery-ajax-method-to-call-an-api/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-use-jquery-ajax-method-to-call-an-api/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 29 Jun 2021 04:46:58 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6580</guid>

					<description><![CDATA[<p>In&#160;this&#160;blog&#160;in&#160;am&#160;going&#160;to&#160;explain&#160;that&#160;How&#160;to&#160;use&#160;JQuery&#160;AJAX&#160;Method&#160;to&#160;Call&#160;an&#160;API&#160;for&#160;to&#160;load&#160;data&#160;from&#160;external&#160;website&#160;or&#160;external&#160;File&#160;of&#160;etc,&#160;by&#160;calling&#160;APIs,&#160;and&#160;get&#160;the&#160;response&#160;in&#160;JSON&#160;or&#160;XML&#160;formats. So&#160;first&#160;thing&#160;I&#160;am&#160;going&#160;to&#160;create&#160;a&#160;html&#160;file&#160;and&#160;import&#160;jquery&#160;cdn.&#160;If&#160;you&#160;want&#160;to&#160;bootstrap&#160;css,&#160;&#38;&#160;js&#160;cdn&#160;the&#160;you&#160;can&#160;copy&#160;from&#160;this&#160;link Click Here as&#160;below- In&#160;this&#160;code&#160;I&#160;am&#160;using&#160;bootstrap&#160;cdn&#160;with&#160;jQuery&#160;cdn&#160;after&#160;that&#160;a&#160;Script&#160;tag&#160;in&#160;this&#160;script&#160;tag&#160;ajax&#160;function&#160;call&#160;with&#160;json&#160;data&#160;for&#160;getting&#160;data&#160;showing&#160;in&#160;cosole.log.&#160;If&#160;you&#160;using&#160;first&#160;time&#160;jQuery&#160;then&#160;you&#160;can&#160;right&#160;button&#160;of&#160;mouse&#160;and&#160;select&#160;inspect&#160;(Ctrl+shift+i)&#160;after&#160;that&#160;showing&#160;below&#160;tab&#160;then&#160;select&#160;console&#160;tab.&#160;When&#160;you&#160;click&#160;Here&#160;button&#160;from&#160;document&#160;then&#160;showing&#160;all&#160;data&#160;which&#160;retrieve.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-jquery-ajax-method-to-call-an-api/">How to use JQuery AJAX Method to Call an API?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In&nbsp;this&nbsp;blog&nbsp;in&nbsp;am&nbsp;going&nbsp;to&nbsp;explain&nbsp;that&nbsp;How&nbsp;to&nbsp;use&nbsp;JQuery&nbsp;AJAX&nbsp;Method&nbsp;to&nbsp;Call&nbsp;an&nbsp;API&nbsp;for&nbsp;to&nbsp;load&nbsp;data&nbsp;from&nbsp;external&nbsp;website&nbsp;or&nbsp;external&nbsp;File&nbsp;of&nbsp;etc,&nbsp;by&nbsp;calling&nbsp;APIs,&nbsp;and&nbsp;get&nbsp;the&nbsp;response&nbsp;in&nbsp;JSON&nbsp;or&nbsp;XML&nbsp;formats. So&nbsp;first&nbsp;thing&nbsp;I&nbsp;am&nbsp;going&nbsp;to&nbsp;create&nbsp;a&nbsp;html&nbsp;file&nbsp;and&nbsp;import&nbsp;jquery&nbsp;cdn.&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;bootstrap&nbsp;css,&nbsp;&amp;&nbsp;js&nbsp;cdn&nbsp;the&nbsp;you&nbsp;can&nbsp;copy&nbsp;from&nbsp;this&nbsp;link <a rel="noreferrer noopener" href="https://getbootstrap.com/docs/4.6/getting-started/introduction/" data-type="URL" data-id="https://getbootstrap.com/docs/4.6/getting-started/introduction/" target="_blank">Click Here</a> as&nbsp;below-</p>



<script src="https://gist.github.com/ajcotocus/5c12c0abb50fa54ae9ba9b2ea64e16e8.js"></script>



<p class="wp-block-paragraph">In&nbsp;this&nbsp;code&nbsp;I&nbsp;am&nbsp;using&nbsp;bootstrap&nbsp;cdn&nbsp;with&nbsp;jQuery&nbsp;cdn&nbsp;after&nbsp;that&nbsp;a&nbsp;Script&nbsp;tag&nbsp;in&nbsp;this&nbsp;script&nbsp;tag&nbsp;ajax&nbsp;function&nbsp;call&nbsp;with&nbsp;json&nbsp;data&nbsp;for&nbsp;getting&nbsp;data&nbsp;showing&nbsp;in&nbsp;cosole.log.&nbsp;If&nbsp;you&nbsp;using&nbsp;first&nbsp;time&nbsp;jQuery&nbsp;then&nbsp;you&nbsp;can&nbsp;right&nbsp;button&nbsp;of&nbsp;mouse&nbsp;and&nbsp;select&nbsp;inspect&nbsp;(Ctrl+shift+i)&nbsp;after&nbsp;that&nbsp;showing&nbsp;below&nbsp;tab&nbsp;then&nbsp;select&nbsp;console&nbsp;tab.&nbsp;When&nbsp;you&nbsp;click&nbsp;Here&nbsp;button&nbsp;from&nbsp;document&nbsp;then&nbsp;showing&nbsp;all&nbsp;data&nbsp;which&nbsp;retrieve.</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="139" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/inspect-for-console-1024x139.png" alt="" class="wp-image-6584" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/inspect-for-console-1024x139.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/inspect-for-console-300x41.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/inspect-for-console-768x104.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/inspect-for-console-1536x209.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/inspect-for-console.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="527" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/console-data-in-ajax-1024x527.png" alt="" class="wp-image-6585" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/console-data-in-ajax-1024x527.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/console-data-in-ajax-300x154.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/console-data-in-ajax-768x395.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/console-data-in-ajax-1536x790.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/06/console-data-in-ajax.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-jquery-ajax-method-to-call-an-api/">How to use JQuery AJAX Method to Call an API?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-use-jquery-ajax-method-to-call-an-api/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JavaScript Cheat Sheet — JSON, Loops, and Promises</title>
		<link>https://www.scmgalaxy.com/tutorials/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises/</link>
					<comments>https://www.scmgalaxy.com/tutorials/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises/#respond</comments>
		
		<dc:creator><![CDATA[dharmendra K]]></dc:creator>
		<pubDate>Wed, 12 May 2021 15:20:55 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScrip]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[loops]]></category>
		<category><![CDATA[Promises]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=6226</guid>

					<description><![CDATA[<p>JavaScript is one of the most popular programming languages for web programming. In this article, we’ll look at the basic [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises/">JavaScript Cheat Sheet — JSON, Loops, and Promises</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">JavaScript is one of the most popular programming languages for web programming.</p>



<p class="wp-block-paragraph">In this article, we’ll look at the basic syntax of modern JavaScript</p>



<h3 class="wp-block-heading">JSON</h3>



<p class="wp-block-paragraph">We can create JSON strings from JavaScript objects with the <code>JSON.stringify</code> method:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="323" height="134" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-3.jpg" alt="" class="wp-image-6231" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-3.jpg 323w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-3-300x124.jpg 300w" sizes="(max-width: 323px) 100vw, 323px" /></figure>



<p class="wp-block-paragraph">And we can convert JSON strings back to JavaScript objects with <strong><code>JSON.parse</code> :</strong></p>



const obj = JSON.parse(json);



<p class="wp-block-paragraph">We can use it to store data in local storage.</p>



<p class="wp-block-paragraph">We’ve to convert objects into strings first to store them.</p>



<p class="wp-block-paragraph">To store objects we call <strong><code>localStorage.setItem</code> :</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="365" height="158" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-4.jpg" alt="" class="wp-image-6232" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-4.jpg 365w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-4-300x130.jpg 300w" sizes="auto, (max-width: 365px) 100vw, 365px" /></figure>



<p class="wp-block-paragraph">The first argument is the key.</p>



<p class="wp-block-paragraph">And we can get data by their keys with <strong><code>getItem</code> :</strong></p>



localStorage.getItem(&#8216;json&#8217;)



<h3 class="wp-block-heading">Loops</h3>



<p class="wp-block-paragraph">avaScript comes with various kinds of loops.</p>



<p class="wp-block-paragraph">One kind of loop is the <strong><code>for</code> </strong>loop<strong>:</strong></p>



for (let i = 0; i < 10; i++) {
  console.log(i);
}



<p class="wp-block-paragraph">We can loop through any kind of iterable object with the <code><strong>for-of</strong></code> loop:</p>



for (let i of custOrder) {
  console.log(i);
}



<p class="wp-block-paragraph">Some iterable objects include arrays, strings, and node lists.</p>



<p class="wp-block-paragraph">Another kind of loop is the <code><strong>while</strong></code> loop:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="244" height="121" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-5.jpg" alt="" class="wp-image-6233"/></figure>



<p class="wp-block-paragraph">There’s also the <code><strong>do-while</strong></code> loop:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="281" height="135" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-6.jpg" alt="" class="wp-image-6234"/></figure>



<p class="wp-block-paragraph">The <code><strong>break</strong></code> keyword lets us end the loop early:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="340" height="148" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-7.jpg" alt="" class="wp-image-6235" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-7.jpg 340w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-7-300x131.jpg 300w" sizes="auto, (max-width: 340px) 100vw, 340px" /></figure>



<p class="wp-block-paragraph">The <strong><code>continue</code> </strong>keyword lets us skip to the next iteration:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="360" height="144" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-8.jpg" alt="" class="wp-image-6236" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-8.jpg 360w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-8-300x120.jpg 300w" sizes="auto, (max-width: 360px) 100vw, 360px" /></figure>



<h3 class="wp-block-heading">Data Types</h3>



<p class="wp-block-paragraph">JavaScript comes with various data types.</p>



<p class="wp-block-paragraph">They include:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="538" height="184" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-10.jpg" alt="" class="wp-image-6239" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-10.jpg 538w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-10-300x103.jpg 300w" sizes="auto, (max-width: 538px) 100vw, 538px" /></figure>



<h3 class="wp-block-heading">Objects</h3>



<p class="wp-block-paragraph">We can create an object with curly braces:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="461" height="179" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-11.jpg" alt="" class="wp-image-6240" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-11.jpg 461w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-11-300x116.jpg 300w" sizes="auto, (max-width: 461px) 100vw, 461px" /></figure>



<p class="wp-block-paragraph">It has properties and methods.</p>



<p class="wp-block-paragraph"><strong><code>this</code> </strong>is the <code><strong>student</strong></code> object itself.</p>



<p class="wp-block-paragraph">We can call <code><strong>fullName</strong></code> with <strong><code>student.fullName()</code> .</strong></p>



<p class="wp-block-paragraph">And we can assign values to properties with:</p>



student.age = 19;



<h3 class="wp-block-heading">Promises</h3>



<p class="wp-block-paragraph">We can create promises with the <code><strong>Promise</strong></code> constructor:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="605" height="212" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-12.jpg" alt="" class="wp-image-6241" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-12.jpg 605w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-12-300x105.jpg 300w" sizes="auto, (max-width: 605px) 100vw, 605px" /></figure>



<p class="wp-block-paragraph">We can <strong><code>resolve</code> </strong>to fulfill the promise with the sum.</p>



<p class="wp-block-paragraph">And we call <code><strong>reject</strong></code> to reject the promise with an error.</p>



<p class="wp-block-paragraph">Then we can call <code><strong>then</strong></code> to get the resolved value and <code><strong>catch</strong></code> to get the error values:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="286" height="149" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/25-13.jpg" alt="" class="wp-image-6242"/></figure>



<h3 class="wp-block-heading">Conclusion</h3>



<p class="wp-block-paragraph">We can work with JSON, local storage, promises, and loops with JavaScript.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises/">JavaScript Cheat Sheet — JSON, Loops, and Promises</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
