---
title: "How can I get jQuery .get to return JSON data?"  
description: "How can I get jQuery .get to return JSON data?"  
author: "Andrew Deniel"  
published: 2013-06-20  
updated: 2013-06-20  
canonical: https://www.mindstick.com/forum/1240/how-can-i-get-jquery-get-to-return-json-data  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# How can I get jQuery .get to return JSON data?

Hi [Developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs), \
I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to [fetch information](https://answers.mindstick.com/qa/93905/how-to-fetch-information-from-a-normal-file-with-ajax) using [AJAX](https://www.mindstick.com/articles/1541/check-availability-of-user-name-or-email-using-asp-dot-net-ajax-and-jquery) from a URL. This URL will return a [JSON](https://www.mindstick.com/forum/34446/convert-json-string-to-object) [response](https://www.mindstick.com/forum/12719/how-to-make-response-write-display-special-character-like-lt-gt) but I am having a great deal of trouble getting this to work. I am fairly new to using both AJAX and JSON so I am not quite sure as to what I am [doing wrong](https://answers.mindstick.com/qa/36736/what-are-indians-doing-wrong-on-whatsapp). I am not receiving any output. Here's what I have so far:\
**[HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript):**\

```
<!doctype html><html><head>    <meta content="text/html; charset=utf-8" http-equiv="Content - Type">    <meta content ="utf-8" http-equiv="encoding">    <title>My Javascript Practice</title>    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>    <noscript>JavaScript Must Be Enabled</noscript></head><body>    <div id="pub">Parent Div</div>    <script type="text/javascript" src="getList.js"></script></body></html>JavaScript:var teamId = 883455;var myUrl = "https://apps-internal.attributor.com/guardianapi/service/csadminservice/csteams/" + teamId + "?view=PUBLISHERS_FOR_TEAM";$.get(myUrl, function(data){    $("#pub").html(data);    alert("load was performed");});
```

**\**Any help on above is really appreciated.

## Replies

### Reply by Sumit Kesarwani

Hi Andrew,\
May I suggest to use something like this:\
**$.ajax({** **type: 'GET',** **url: myURL,** **data: yourDAta,** **dataType: 'jsonp',** **success: function(jsonData) {** **alert(jsonData);** **},** **error: function() {** **alert('Error loading ');** **}****});****\**Note the usage of jsonp over json\


---

Original Source: https://www.mindstick.com/forum/1240/how-can-i-get-jquery-get-to-return-json-data

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
