jsonp

How to determine if a Post contains a specific Category in a JSONP feed using jQuery?

爱⌒轻易说出口 提交于 2019-12-13 09:53:50
问题 I need to detect if a post contains a specific category from a JSONP feed. I'm not sure how to read the array as it's currently saying it's null. The link works without any problems though, which is just a string. $.jsonp({ url : "theurl", dataType : "jsonp", timeout : 10000, success : myFunction, error : myErrorFunction }); function myFunction (data) { $.each(data, function(i, post){ var link = post.permalink, hasCategory = $.inArray("specialcategory", post.categories); }); } Here's an

Correct web-api controller action method definition for jsonp request

五迷三道 提交于 2019-12-13 06:14:03
问题 I have a simple web api controller action method: public class WeightController : ApiController { [HttpGet] [AcceptVerbs("GET")] public int GetWeight(int weightId) { return 5; } } I use default route config for webapi public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } I need to do cross domain call so I use jsonp call: $.ajax({ url: 'api/Weight/1',

Angularjs http.jsonp iOS9 404

给你一囗甜甜゛ 提交于 2019-12-13 05:55:12
问题 I have a Cordova Angularjs app that is getting some JSON from my server. It works on iOS 8, but when I "upgraded" to iOS 9 I am now getting nothing from my server. The server has not been changed, and I can see the JSON response if I navigate to my url. I narowed it down a little to my $http.jsonp() method. It is giving me a 404 error when trying to retrieve the JSON. The same exact code works fine and gets the JSON on an iOS 8 device. Anyone else having an issue with this and iOS 9 and have

passsing data to https by JSON using JSONP

我与影子孤独终老i 提交于 2019-12-13 05:35:49
问题 i had try many diffrent tutarials and examples from http://api.jquery.com/jQuery.getJSON/ and Post data to JsonP and saw many staffs about how to convert json data to jasonP but still i can not do it,is there any one could see how should i pass my data over https within my codes here which i am using highcharts to get data from my domain sql server which is in diffrent server than my webpages host.here is my codes:(i know which i should use ajax request but i dont know how in my case,if

“invalid label” parsererror with jQuery and Yahoo's Geolocation APIs

好久不见. 提交于 2019-12-13 05:33:58
问题 I'm using jQuery to access Yahoo's Geolocation APIs. Even though I am able to successfully retrieve data from their servers, I cannot get jQuery to successfully parse the data. I've tried both $.ajax() and $.getJSON, each returns the same failures: parsererror and "invalid label". Through my digging on the interwebs, I've discovered that "invalid label" is likely the result of the JSON not being wrapped in parentheses, but I can't figure out how to wrap the data up, prior to it getting parsed

Json RPC string

左心房为你撑大大i 提交于 2019-12-13 05:33:25
问题 I am using jquery to send json rpc requests to rempte server. Here is my jquery code: var jqxhr = $.getJSON("https://91.199.226.106/ssljson.php?callback=?", splited[1], function(data){ alert("aaaaaa"); }); jqxhr.error(function() { alert("error"); }) Where spleted[1] isthe json string I am sending to server. I am getting this message from google chrome: Uncaught SyntaxError: Unexpected token :ssljson.php:1 Error code is : {"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid

This web API does not have CORS enabled; how can I use it?

≡放荡痞女 提交于 2019-12-13 05:18:29
问题 I want to make an Ajax request to the ChemSpider Web Api from a web application that I'm making -- for example, using the GetCompoundInfo search function. This API returns its data in XML format. For example, a search for pyridine: GetCompoundInfo?CSID=1020&token=redacted-security-token results in <?xml version="1.0" encoding="utf-8"?> <CompoundInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.chemspider.com/"> <CSID>1020

How to POST JSON request in cross domain in sencha touch

廉价感情. 提交于 2019-12-13 04:32:35
问题 I have got following URL https://development.avalara.net/1.0/tax/get and would like to POST following JSON request body { "DocDate": "2011-05-11", "CustomerCode": "CUST1", "Addresses": [ { "AddressCode": "1", "Line1": "435 Ericksen Avenue Northeast", "Line2": "#250", "PostalCode": "98110" } ] } which then will give JSON response { "DocCode": "78b28084-8d9a-477c-9f26-afab1c0c3877", "DocDate": "2011-05-11", "Timestamp": "2011-05-11 04:26:41", "TotalAmount": 10, "TotalDiscount": 0,

JsonP scriptTag extjs4.1 issue

时光毁灭记忆、已成空白 提交于 2019-12-13 04:03:20
问题 i got the following server response: callback({ "data": [ { "id": "13_gnomodotiseis", "id1": 13, "title": "5/2009 ΓΝΜΔ ΕΙΣΑΠ 2009", "text": "5/2009 ΓΝΜΔ ΕΙΣΑΠ ", "model": "gnomodotiseis", "body": "σίλει...", "type": "text", "history": "old", "url": "", "search_tag": "Γνωμοδοτήσεις", "new_element": "true" } ], "dataset": 1 }) I have a store definition like this: var baseUrl = 'http://localhost:8090/'; Ext.define('Ktimatologio.store.NewSingleBlockStore', { extend: 'Ext.data.Store', alias:

SharePoint GetListItems Across Domain

淺唱寂寞╮ 提交于 2019-12-13 03:17:37
问题 I basically need to perform a GetListItems from a SharePoint list on a different server. I have tried different codes but they all error out. Can someone look at what I have and see if it's wrong or if it's just not possible? I get the Error alert then an xData.ResponseText alert as 'undefined'. Nothing after that. The server where I'm running the code is server3.intranet.com. Thank you. var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \ <soapenv