Click here to Skip to main content
15,885,365 members
Everything / JSONP

JSONP

JSONP

Great Reads

by Matthew Dennis
jQuery has changed its implementation of how it creates JSONP requests in a way that can break some applications.
by Thrivikram Hathwar
Sample to demonstrate building a cross domain script enabled WCF REST service and consuming it in a web app.
by Gil Fink
How to use the datajs library in order to make a JSONP call to a JSONP enabled WCF Data Service.
by Gil Fink
A simple example of making a JSONP call to a WCF Data Service using jQuery.

Latest Articles

by Florian Rappl
JSON Schema may be the answer to most problems in dealing with JSON files. We explore JSON Schema from a practical point of view.
by Alexander Parra Lorenzo
example to request a JSON data
by henry sentio kauta
Android at figure tips
by Ricardo Lynch
Using JavaScript for oAuth with three major identity providers: Facebook, Google, and Twitter.

All Articles

Sort by Score

JSONP 

5 Apr 2011 by Matthew Dennis
jQuery has changed its implementation of how it creates JSONP requests in a way that can break some applications.
9 Jul 2012 by Thrivikram Hathwar
Sample to demonstrate building a cross domain script enabled WCF REST service and consuming it in a web app.
22 Nov 2011 by DaveAuld
Have a look at the document.reffererhttp://www.w3schools.com/jsref/prop_doc_referrer.asp[^]For example, if I code to may CodeProject profile, click my HomePage icon, this will load up my website in the browser, if I then inspect the page with the browser debugger and put...
25 Apr 2011 by Gil Fink
How to use the datajs library in order to make a JSONP call to a JSONP enabled WCF Data Service.
25 Apr 2011 by Gil Fink
A simple example of making a JSONP call to a WCF Data Service using jQuery.
12 Apr 2012 by Leng Vang
I'm wondering if anyone would still interested in create Android app interact with .NET WCF REST Service under OData4j using JSON format. Also some handling on Android's basic listview and dialog boxes. I just went through created an application using these technology and its not easy figuring...
8 Jan 2013 by Sandeep Mewara
Following should help:Refer: JSON and JSONP[^]Example implementation: Cross-domain JSONP with jQuery call step-by-step guide [^]
10 Jan 2013 by Tharaka MTR
you can increase the size of the query by incresing the maxJsonLength.Please try adding following code to the web.config file. if you need any help please send a message
22 Aug 2014 by Alexander Parra Lorenzo
example to request a JSON data
30 Dec 2016 by Richard MacCutchan
See JSON Schema - Google Search[^].
9 May 2011 by Rick Shaub
As far as security goes, JSON is basically plain-text so any sensitive data would need to be sent encrypted (HTTPS perhaps?).
4 Sep 2011 by blogginssyndicate
Blogging Syndicate qtelwsewn cfdeeqpz u kfxgqicwc rywwypvqm zhkf rba qf tkhhqjnna ybmtdb vib yiwfdsyie wbuape quw kbrygihdo snaiji yyh ...
15 Oct 2011 by Jules Bartow
My dataType:json call to WSEzPL8.asmx/GetCompaniesJSON for a jQuery auto-complete dropdownlist list inside a jQuery dialog works great (just in case anyone is having problems getting their AjaxControlToolkit ComboBox inside an AjaxControlToolkit ModalPopupExtender to work). Fiddler shows JSON...
22 Nov 2011 by Md. Tarek Showkot
Hi,I am currently working on my own project, this is a simple web application integrated with a SMS Gateway!! now I what I want is - 1. I want to where my visitors are coming from? like I have a Facebook page for that site. I want to detect if any user is visiting my site from that...
8 Apr 2012 by Gabriel Sas
This is the WCF Service code:[OperationContract] [WebGet(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)] public String GreetJson() { Greeting g = new Greeting(); ...
12 Jun 2012 by Karthik. A
Looks like $.getJSON will be more helpful in this case. Refer this thread - http://stackoverflow.com/a/2383363/312219[^] and this thread http://stackoverflow.com/questions/2414899/why-isnt-jquery-automatically-appending-the-jsonp-callback[^]. These 2 links might help you.Update: I suddenly...
11 Jul 2012 by BJC23
Can anyone point me to some example code that shows how to setup a cross domain webservice that will return JSON in a .asmx / ASP.NET 3.5 page? Cant seem to find a comprehensive examples. I want to avoid MVC or WCF - especially now that the ASP.NET Web API is the latest and greatest but the...
22 Jul 2012 by woutercx
It would be easy with WCF:http://www.west-wind.com/weblog/posts/2007/Oct/04/WCF-and-JSON-Services[^] even though you say you want to avoid WCF.
27 Sep 2012 by Dexter11
I dont know whether i am asking valid questionMy problem is i want to send large data from one application to another for which i am using JSONP to pass data to handler file which stores it in database.As the data is large i am dividing it in chunks and passing the packets in loop, the more...
4 Oct 2012 by Dexter11
Can we remove the limitation on data send using JSONP. Below is my code. What i am trying to do is to pass 3000 characters(actuallly a image which is converted to base64 data) at a time to service(serviceCall.ashx). As my data is large up to 30,000-40,000 characters i am dividing it in...
4 Oct 2012 by Mehdi Gholam
Read the following : http://stackoverflow.com/questions/9121158/json-parameter-size-limit[^]
27 Oct 2012 by Zoltán Zörgő
As I see, this is a cross-domain call. Thus a simple getJSON won't be enough. Consult the legacy ajax[^] method to see how you have to set parameters for a JSONP call.
29 Oct 2012 by Member 9459463
Guys i am trying to hit this webservice which returns me a json...
8 Jan 2013 by revanthkumar.ch
Here is My code ..could anyone please solve this problem..I was struggling from morning..below code is not working.Actually i should get the data when we send jasondata as input..but i am getting error.its a public web-service site.
8 Jan 2013 by Shafik
Hi all,I am using the script below but it s not redirecting the page.string rdpConnect = "function btnShowID_onclick(){" + "if(document.getElementById('MainContent_ctl00_txtBeginDateID').value!='' && document.getElementById('MainContent_ctl00_txtEndDateID').value!='' &&...
8 Jan 2013 by E.F. Nijboer
What if the condition is true, but the ajax call isn't a succes? This would not show. Try to add code for the error situation, like this:$.ajax({ url: ..., data: ..., dataType: 'json', type: 'POST', timeout: 10000, success: function(json){ //some code ...
15 Jan 2013 by Mahesh Kumar Badgujar
My requirement is like i have a website abc.com and my database is on xyz.comNow i have to retrive data on abc.com from xyz.comI have tried xmlhttp, even after putting cross domain policy XML it is not workingwith JSON, i am not able to understand the structure of the process, what...
15 Jan 2013 by Tharaka MTR
for the cross domain you have to use the JSONP instead of JSON. Please see below for more detailsHere is the nice articles for your...
18 Jan 2013 by Dexter11
I am trying to pass large data(image data up to 90,000 characters) from one domain to other for which i am using jsonp, as there's limitation to size of data passed using jsonp i am sending the data in packets. Is there any way to compress the data being passed so the number of packets will get...
18 Jan 2013 by Tharaka MTR
Yes, there are some limitations. please read my blog for more details(413) Request Entity Too Large[^]http://tharakaweb.com/2012/12/11/413-request-entity-too-large/[^]In addition, when you are serializing JSON also have some limitations. you can avoid this by modifying your web.config...
12 Feb 2013 by rajan1189
$.getJSON(serviceURL + 'getemployees.php', function(data) { });i want to get data from this json object and save it into array ,,
23 Feb 2013 by Mahesh Kumar Badgujar
I have a database on server like abc.com which support Php.now i want to use this on my blogger blogspot website.How to do this???????
9 Apr 2013 by Prasad Khandekar
Hello,Since this is a continuation of your last question[^] I am putting up a small snippet to show how this can be done (Assuming parameter ticker represents value you want to replace. function createChart(ticker) { $.support.cors = true; //Ajax call retrieves the data from Yahoo!...
23 May 2013 by Mahesh Kumar Badgujar
I have a database on server like abc.com which support Php. now I want to use this on my blogger blogspot website. How to do this???????
25 Jun 2013 by engmebeed
I have a web service to send email, when i send it small message it send successfully.If i send a lot of date in the message it return with Fault in sending email, I try to set maxJsonLength="500000000" in web config, but still there is error.Could you please help me in this situation. ...
30 Aug 2013 by Aarti Meswania
hello experts,I am new to javascripts please help me to solve this,I have a function for db trip. that fires on every 10 mili seconds. problem is data is varying some time it gives 3 records sometime 5 records. there is not an issue of sp parameters I have passed. I think it's due to...
1 Sep 2013 by Sreejith MV
JavaScript is a single-threaded environment, meaning multiple scripts cannot run at the same time. For solving this issue in we can you a web worker. Web Worker defines an API for running scripts in the background independently of any user interface scripts. It will Run in an Web Workers run...
29 Sep 2013 by sarthakm
Can any one please give an example of communication between 2 asp.net(Not MVC Application) website using JSON?i.e. without help of WCF or webservice.....??
30 Sep 2013 by Gergo Bogdan
Wouldn't Websockets and IndexedDB work for you?
19 Nov 2013 by Suvabrata Roy
Hi,Six simple steps to use a Stored Procedure in LINQ[^]When you add Procedure to DBML then its automatically create output class and which you can use as a Data Contract and returned the same data in JSON
19 Nov 2013 by Er Daljeet Singh
your requirement is you are using Linq To Sql means a DBML file.and you are having a store procedure on it.now are executing the storeprocedure and want the output from store procedurehere i am creating a store pCREATE PROCEDURE Stock.usp_CheckBuyBookByISBN -- Add the parameters...
21 Nov 2013 by anglo0072
Hi expert and every one i invite you to plz discuss this question and shows some your experience and technic.. i have been searching over internet from couple of days that1. How to Create a Webservice that retrieve the JSON Data from Server (because i dont want any post back specially while...
24 Nov 2013 by elagamy
i have aproblem when display my page with json return null in alert message , webservice return my normal data , but not display on pageweb service (DirectoryService.asmx)Public Class GetDirectory Inherits System.Web.Services.WebService _ Public Function...
25 Nov 2013 by elagamy
no body now to help no body now to help
7 Apr 2014 by nbharathidhasan
I wrote a sencha code for loading an Jsonp webservice. But now I am getting the Ext.Util.JSONP itself as undefined. So I could not able to make request. Please help me in loading the data. I hope ,I am not missing any reference. I can able see the Ext.data.Jsonp or Ext.Util.JSONP in the...
22 Apr 2014 by monstermdk
I was able to use the following link to resolve this issue.http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api[^]
31 Jul 2014 by Rajendra Kr. Rana
i created a wcf web service to search the data corresponding textbox entry.i use jquery ajax function to consume the services. it working fine in IE. but when i tried to use it in Chrome and Firefox its not working.i googled but not able to find any good solution. can any body please help on...
14 Dec 2014 by KP Singh Chundawat
Hello folks,I am needed your guide that how to upload a file from Asp.net MVC Using WCF Rest service calling from Jquery-Json/Jquery-Ajax without page refresh .I don't want to use Ajax Update panel or something other .i want to upload file without page refresh WCF Rest.If its is possible to...
14 Dec 2014 by Afzaal Ahmad Zeeshan
To upload the files without a POST request (page refresh) you would need a client-side framework. JavaScript is one of them. You should be using jQuery, to make things easier.You can create a new ajax request (Ajax request is required, there is no other way for you to send the data to the...
15 Dec 2014 by KP Singh Chundawat
Thanks for this Ahmad Zeeshan sir...yeah that is good if it is possible using Jqury..Please give me Code idea ..Actually my requirement is that fileupload in Client side or Without Page Refresh ....Thanks
11 Feb 2015 by anup.bhunia
Referhttp://stackoverflow.com/questions/19446592/consume-php-soap-webservice-in-winform-c-sharp[^]
18 Mar 2015 by miss786
I am trying to create a cross domain ajax POST call but when I run the ajax function below, it displays output as 'undefined' instead of the data from the database. $(document).ready(function () { $.support.cors = true; $.ajax({ ...
18 Mar 2015 by Afzaal Ahmad Zeeshan
That is because the result is an array, that is being return to your client. List details = new List(); // new generic list// At the endreturn details.ToArray(); // convert to array and send to clientBut you're trying to access an array member of this response array; such as a...
24 Mar 2015 by vishnujeet
guy below i given my code sample it's returning (Uncaught ReferenceError: updateData is not defined) error . could you help me to find what i am missing , pls help me to make it workable . here you can find code , my service returning JSONP response . var student =...
31 May 2015 by diggudg
I'm not able to read response of jquery ajax on success full execution of jquery function and on status 200 ok error function is running.Please help, for reference see below code $(document).ready(function () { $('#loadingPanel').hide(); ...
18 Sep 2015 by Grant Weatherston
You will need to allow cross site origins in your webconfig file. This is simply done using the following tags in your webconfig. You can replace the "*" with the domain you are making the request from (the origin).also make sure crossDomain: true,on your ajax...
1 Jun 2016 by .net developer123456789
Here working code Create JSON file for Desktop application :-private void GenerateJSONFile(List WorkList) { string jsonString = ""; JsonSerializerSettings J = new JsonSerializerSettings(); J.NullValueHandling =...
1 Jun 2016 by VR Karthikeyan
These are very good links to know about how to write json to a file, try them.1. Write JSON to a file[^]2. How to write a Json file in C#? - Stack Overflow[^]
26 Jul 2016 by Member 12444066
Hi,There is REST API, from which I am trying to fetch response.Issue is if I use JSONP to overcome cross-domain issue then I get error_code:1000 in console.This is the response I get in console:Object {header: Object, body: Object} body:Object error_code:1000 ...
7 Nov 2016 by IsiR_19
Hi guys I am currently working on an autocomplete which uses a jsonp data type, issue i am having is when i am returning data from my controller it is returning the data in the following format{"aaData":[{"SId":"934155","Name":"ABC...
7 Nov 2016 by Scyldshefing
I would suggest that you look at [wikipedia JSONP] Your sample code does not seem to support your issue (could you supply more details about your controller? you seem to be switching between customer/supplier)I have tried the following :Newton soft serialiser:public class UnitTest1 ...
26 Jan 2017 by Vikas Hire
Hello there's..I want to concatenate two json string.first string contains data tables records details and other string contains Count value.I get that values In data set such that.dataset ds.Tables[0]= //table records ds.tables[1]=// singale integer value (e.g....
26 Jan 2017 by Richard Deeming
Try something like this:json = JsonConvert.SerializeObject(new { contactList = ds.Tables[0], totalCount = ds.Tables[1].Rows.Cast().Select(r => r[0]).FirstOrDefault()}, Formatting.None);
3 Jan 2019 by biswa85
I want to get data from this domain ![^] ( I will will edit source of the code of the above mentioned domain from chrome and paste the code , then through jquery timer I will fire post request to send data to specific interval to a separate domain . Other words send data from ABC Home...
2 Nov 2019 by Member 13039327
Dear all, In Visual Basic I have the code that I can get the company details by entering their VATnumber. Now the result I am getting is in 1 big json string. Now I have heard that VATlayer also can work with a JSONP Callbacks, this however, I can't seem to figure out how to put in the code so,...
2 Nov 2019 by RickZeeland
Example: http://apilayer.net/api/validate?callback=CALLBACK_FUNCTION[^] You can find the documentation about JSONP Callbacks here: Documentation | vatlayer API[^] You can generate a class for the JSON response here: JSON Utils: Generate C#, VB.Net, SQL Table, Java and PHP from JSON[^] Public...
2 Jan 2022 by Ubaldo Formichetti
Hi, I need to build a wcf service, which uses a custom response, in jsonp format, I should get a response like this example: calling this example method:...
2 Jan 2022 by Ubaldo Formichetti
HI, somehow I managed to solve it, I don't know if this is the best way, however I solved my problem, like this: The service: I removed the interface file, added the MyType class, which has a settable object "d" property, which I then return as...
13 Mar 2018 by Florian Rappl
JSON Schema may be the answer to most problems in dealing with JSON files. We explore JSON Schema from a practical point of view.
10 Jul 2014 by Ricardo Lynch
Using JavaScript for oAuth with three major identity providers: Facebook, Google, and Twitter.
25 Apr 2012 by Jovan Popovic(MSFT)
Basic concepts of creating pure JavaScript applications using jQuery, JavaScript View Engines, and web services that provide JSON results that are accessed by JavaScript code via AJAX calls.
25 Sep 2011 by Gary Stafford
A simple example of a non-ASP.NET restaurant menu and order form, which interacts with cross-domain RESTful WCF Services using JSONP and jQuery
25 Jul 2014 by henry sentio kauta
Android at figure tips
9 May 2011 by suprcodr
Hello all!So here is my current predicament: I need to run some javascript within a page that, every 30 seconds, posts a JSON object back to a PHP web service that resides on a different domain. Once this data makes it to the cross-domain, it is taken by the PHP web service and pushed into a...
12 Jun 2012 by Developers Code
I am trying to access the data from server(other domain).I have a created a Webservice called hellojson.asmx which is in serverEx: www.example.com/services/JsonWeb.asmxWebservice code: SqlConnection con = new...
4 Oct 2012 by deepakdynamite
Hello Everyone,We have created REST services using web API and successfully deployed on our Testing Servers. When check those services using POSTER (tool comes as addon in Mozilla and used for testing services), we get perfect output. But when we do Jquery Ajax call, we face error of "...
27 Oct 2012 by Member 9459463
Hello guys ,Stuck at a problem for two days . The problem is that i am trying to hit a webservice from localhost .Just for testing purposes i wrote this code and it ran the way it was supposed to :
22 Dec 2012 by Member 7966831
I am trying to load options for select2 from a list.Here is what I have done so far:View----Js file-------$("#myInput").select2({ placeholder: "select from the following", ajax: { ...
10 Jan 2013 by Dexter11
I am trying to pass data across different domain using jsonp. Code to call my service$.ajax({ type: "GET", url: window.serviceURL + "CheckWebsite", data: { domain: domainName, website: sitename }, dataType: "jsonp", contentType:...
9 Apr 2013 by Member 9592868
Im fetching JSON data using an AJAX call and theres a variable in the ajax URL that I want to change when a user types in a new variable in an input box. E.g. it starts as www.'AAPL'.com but if a user types 'GOOG' then the variable in the url will change so the new url is www.GOOG.comI...
22 Apr 2013 by Dexter11
I am using following link to make jsonp call https://raw.github.com/betamax/getImageData/master/jquery.getimagedata.js[^]My jsonp call $.jsonp({ //async: true, //crossDomain: true, type: 'GET', timeout:...
5 Aug 2015 by K N R
Hello There,My Ajax cross domain request is failing in IE 11 with "Access denied". I have read through several posts regarding this topic, and done below changes but getting same issue.1) Call is async=false, dataType='json' and crossDomain, cache is false. These are the...
1 Jan 2013 by Member 9658543
which is the best json api for fm radio or internet radio?which json api is dere for indian live tv?
19 Nov 2013 by kingsa
Hi , I want to how to retrive data using store procedure in wcf in json format with linq to sql classesI want to retrieve store procedure's out put using WCF in JSON format and I am using LINQ to SQL classes.
28 Mar 2014 by Gaurav Gupta A Tech Guy
How to do Cross Domain Request a Json ?Please help me out. I have used ajax as well as get and getjson methods but it didn't work.I have different application in PHP from which i'll receive data.
28 Mar 2014 by R-a-v-i-k-u-m-a-r
For Cross Domain Request, you have to mention datatype 'jsonp'Jquery Cross-Domain ajax call using JSONP[^]
23 Jun 2014 by Anil Singh 2010
It might help youhttp://www.code-sample.com/2013/11/ajax-json-cross-domain-call-to-rest.html[^]
11 Feb 2015 by Brinda Lakhani
Hello friends,I am developing a window application in C#.I want to consume the data from web service in my window application using soap and that web service is developed in PHP. So how can I do it?Also, I want to ask that, Can I pass URL directly in code without adding web reference?
30 Dec 2016 by Member 12928136
I am completely beginner to JSON Schema and i know what is JSON Schema but need to know that how can i link JSON Schema to my JSON, to validate against that JSON Schema ? Can any one explain ?What I have tried:I am failed and didn't try because i am unable to understand about linking the...