aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Get JSON Data/Response From URL in JavaScript

Feb 24, 2013
Here I will explain how to get
JSON data from url in JavaScript or jQuery get JSON response from url in JavaScript.

In previous posts I explained Create Short urls using in javaScript,
jQuery Get number of facebook likes, shares count for url, jQuery Google Currency Converter API Example and many articles relating to jQueryJavaScript, Now I will explain how to get JSON response or data from url in JavaScript.

To get JSON data or response from url in JavaScript we can write in different ways like as shown below

Method 1:

<script type="text/javascript">
$(function() {
$("#btnSubmit").click(function() {
function(data) {
alert("Your IP Address: " + data.ip);
.error(function() { alert("error"); })
For complete example check this post Get IP Address of Client Machine in jQuery

Method 2:

<script type="text/javascript">
function yourmethod(data) {
alert('City : '' Country name : '+data.countryName);
<script type="text/javascript" src=""></script>

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...

How do you do this for https url?

I need to pass client certificates along with URL.. But I am getting 500 Internal error.

Please help me on this

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.