Questions tagged [jsonp]

JSON padding (also known as JSONP) is a clever strategy devised to overcome the restrictions of cross-domain AJAX requests.

JSONP cross-origin request issue

Is it possible to determine the response status when making a JSONP request? For example, can you tell if the request was successful with a 200 OK status, or if the resource was not found with a 404 error code? Alternatively, is there a method to attempt ...

Show information retrieved from fetch api

Hi there! I've been trying to fetch data from the Avascan API and display it on my HTML page, but so far, I haven't had any luck. I've experimented with using the Fetch API, JSON, and AJAX methods, but none of them seem to work for me. Do yo ...

Ways to insert text at the start and end of JSON data in order to convert it into JSONP format

Currently, I am working on a project where I need to add a prefix "bio(" and a suffix ")" to my JSON data in order to make it callable as JSONP manually. I have around 200 files that require this modification, which is why I am looking for a programmatic ...

"Is there a way to retrieve "Lorem ipsum" information from a web service in JSON format

Does anyone know of any sample web services that serve JSON data? I'm looking to practice consuming JSON for testing and learning purposes. I would even be interested in downloading JSON files with images and other content to study offline. Perhaps th ...

Display a message after serializing JSON in my cakePHP application

Is there a way to append something at the conclusion of the cakePHP json/xml output? This is necessary for incorporating JSONP capability (Since I must insert the callback at the start and ');' at the end) This is how the controller is set up: ...

Discovering a specific JSON object member by its corresponding string value

Let's consider a JSON file with information about books stored in it: { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "autho ...

What is the process for creating a widget that can be seamlessly integrated into someone’s website and hosted on your own site

In relation to this previous question. After researching JSONP and conducting some tests, I've realized that I am completely clueless about what I'm doing... What is required? I am developing a customer service tool for people to integrate into their w ...

What is the most effective way to extract the output from a JSONP request and utilize it beyond the

I have a function that is working well. I had to use JSONP to handle cross-domain issues, and I also wrote an HTTP module to change the content-type. However, I did not include a callback name in the URL. function AddSecurityCode(securityCode, token) { va ...

Retrieving data from Google Places API in JSON format

Having some trouble with the Places API, I initially attempted to use $.ajax from jQuery but kept encountering an unexpected token error on the first element of the file. It turns out that JSONP cannot be fetched from the Places API. Below is a snippet of ...

Retrieving external JSON data with JavaScript

I am attempting to utilize a specific service for proxy checking. They offer an uncomplicated API that delivers JSON data. My goal is to retrieve this JSON on my own server. Despite various attempts, I consistently encounter either a CORS request issue or ...

What is the best way to handle JSONp response parsing using JavaScript?

I'm relatively new to working with Javascript and I am currently attempting to retrieve data from an External API located on a different website. My goal is to extract the information, parse it, and then display specific parts of it within my HTML pag ...

Transforming a JSONP request to automatically parse a text response into JSON

If I have the following request $.ajax({ type: "GET", dataType: "jsonp", jsonp: "callback", jsonpCallback: "my_callback", url: my_https_url, headers:{"Content-Type":"text/html; charset=utf-8"}, success: function(data) { ...

Exploring the getJSON function within jQuery

{ "Emily":{ "Math":"87", "Science":"91", "Email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d6f7e767c51767b727e737f764f747879">[email protected]</a>", "City":"Chicago" }, "Sa ...

Decoding JSON data in jQuery using JSONP

Here is a JSON file: { "weather": [ { "location": "G", "temp": "9" }, { "location": "L", "temp": "6" }, { "location": "W", "temp": "10" } ] } This is the script I used: <script ...

Utilizing Ajax to make JSON requests using jQuery

I could really use some assistance here. I have a JSON file and I am attempting to retrieve only one image file by specifying its position, like the first one, for example. Is this achievable? I have experimented with various methods but it seems like some ...

Error: Jsonp callback not functioning properly on Internet Explorer

I have been using JSONP to retrieve data from an API through AJAX. After testing my code on Firefox and Chrome, it has worked flawlessly in these browsers. The link I am utilizing follows this format: www.placeholder.com/foo/?jsonp=dataCallback Yet, ...

I'm having trouble getting my jsonp to function properly. Can anyone help me troubleshoot?

I've been working on my website for the past two weeks, learning HTML, CSS, and a bit of JavaScript. However, I'm facing an issue with the following code that I can't seem to resolve: <head> <script src="http://ajax.googleapis.com/ajax/libs/jquer ...

Managing JSONP calls in ZEND is crucial for handling cross-domain requests

After conducting a search and not finding an answer, I have decided to ask the question myself. Can the Zend Framework handle JSONP calls? I came across this page: http://framework.zend.com/wiki/display/ZFPROP/Zend_Json_Server+-+Lode+Blomme However, I a ...

jQuery fails to retrieve JSONP data from an external source

I want to determine if a stream is live on justin.tv. They offer an easy-to-use JSON API, where by querying http://api.justin.tv/api/stream/list.json?channel=channel_name it will provide specific JSON information if the stream is indeed live. var url = ...

Having trouble accessing news feed with jQuery due to an unexpected token error when attempting to cross domains

I am attempting to access the Yahoo News feed from a SharePoint site, but it is causing a cross-domain access issue. Despite trying various solutions found on numerous websites and blogs, I still cannot resolve the problem. (I am executing this code in the ...

Using AngularJS service to perform a GET request

I'm just starting to learn about angularJS and I'm trying to understand how to make a GET request to an external server. The documentation provides an example request like this: Example Request curl -H 'Accept: application/vnd.twitchtv.v ...

Converting Sencha Touch XML response to JSON format

Embarking on a Sencha Touch project utilizing existing Web services has presented me with some challenges, as I am still new to this technology. Problem: My current challenge involves calling a login service with the following request: http://domain.sub. ...

Error encountered while using the jquery with Twitter Search API

Looking to initiate a twitter search using the jquery and the twitter api, I consulted the documentation before writing this code: $.getJSON("http://search.twitter.com/search.json?callback=myFunction&q=stackoverflow"); function myFunction(r) { co ...

Converting strings into the right values through parsing

I have a JSON response that contains multiple suggestions, but I only want to parse and extract the 4 "collation" results: jQuery191029421305245357143_1380819227858( { "responseHeader": { "status": 0, "QTime": 127 }, "command": ...

Extracting information from within Ajax's Jsonp

How can I retrieve data from the Ajax function(result)? Why isn't this app working? Please assist me. function star(a) { var res; $.ajax({ url: 'https://api-metrica.yandex.com/analytics/v3/data/ga?end-date=today&ids=ga%3A35416355& ...

Having trouble passing multiple parameters in a jQuery AJAX request?

I'm currently working on implementing a .NET web service (asmx) using JSONP with guidance from this helpful tutorial. When I try calling my webservice with only one parameter, everything runs smoothly. However, the moment I attempt to call it with multipl ...

JSONP - Remote Server Denied Access with Error 403

I've encountered an issue that has been puzzling me for the past two days without any success: The Issue : My RSS Parser works perfectly fine on my Localhost, but when I try to run it on my Hostgator domain, it refuses to make requests. Is there any ...

JSONP Error - "SyntaxError: Unexpected token caught"

Just to start off, I want to mention that I'm new to working with jsonp. This is my first time diving into the world of JSONP. Currently, I'm using a jQuery ajax call to retrieve data from a website. Here's a snippet of my jQuery code: $.fn.checkTPS = f ...

Failure of jQuery ajax success callback to trigger

I have been using jQuery's $.ajax method in my code to fetch data from a JSONP-compatible web service. It seems like everything is working fine as I am able to receive the response and display the data in my HTML. However, I am facing an issue where the aj ...

Sharing a single JSON object among Angular.JS controllers enhances collaboration and boosts efficiency

My current project involves coding a CRUD app using Angular.JS, and I could really use your expertise to move forward. Here is the situation: View 1 (index) retrieves JSONP data from a remote API and saves it. View 2 (master) displays filtered data on a ...

Error: The JSONP request encountered an unexpected token, causing a SyntaxError

Asking for data using AJAX: $.getJSON('https://www.cryptocompare.com/api/data/coinsnapshot/?fsym=BTC&tsym=USD&callback=?', function(result) { console.log(result); }); Encountering an error: "Uncaught SyntaxError: Unexpected token :" Not sure ...

Ruby Guide: Parsing JSONP and Storing JSON Data in a Database

Looking to extract and store JSONP data in a database using Ruby or Ruby on Rails? Here's the scenario: Let's assume you have a JSONP URL like, This JSON format isn't typical, so how can you parse it in Ruby/Ruby on Rails and then save the extracted data ...

Using PHP to send JSONP callback responses

Is it possible to achieve "two-way" communication using JSONP and PHP? For example: jQuery / JSONP $.ajax({ url: 'http://server/po.php', cache : false, dataType: 'jsonp', timeout: 30000, type: 'GET', data: {a: 'hello'}, succe ...

What is the method for accessing cookies using JSONP?

Hello, I am trying to load a page from index.html using the following code: <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.2.min.js"></script> <script> function jsonCallback(json){ console.log(json); alert(document.c ...

Click the link to find the JSON node that corresponds to the onclick event

After parsing JSON, the JS code below is returning a list of movie titles for me. Each movie title node contains additional attributes and values that are not currently being displayed. My goal is to have the other values in that specific node displayed wh ...

How to Ensure the Security of JSONP?

Currently, I have a script that utilizes JSONP for conducting cross domain ajax calls. While it is functioning effectively, I am pondering if there is a method to hinder other websites from accessing and retrieving data from these particular URLs. My goal ...

Unlocking the Magic of JSONP: A Comprehensive Guide

Currently attempting to utilize JSONP in order to work around Cross Domain challenges. I referenced this solution: Basic example of using .ajax() with JSONP? $.getJSON("http://example.com/something.json?callback=?", function(result){ //response data a ...

I'm experiencing a lack of feedback while implementing jQuery/AJAX with JSONP

Attempting to perform a cross-domain request using jQuery/AJAX, I have the code below; $.ajax({ url: "http://www.cjihrig.com/development/jsonp/jsonp.php?callback=jsonpCallback&message=Hello", crossDomain:true }) .done(function( msg ) { alert( ...

Trouble with Jsonp when using the getJSON function in jQuery

$(document).ready(function() { $.getJSON("http://quanta.net16.net/wordpressnew/test.php?jsoncallback=?", function(data) { alert('swag'); }); }); This is the JSON request I'm making and my data is properly contained within ?({object} ...

Assistance with JSONP (Without the use of jQuery)

I've been putting in a lot of effort trying to understand how to make a JSONP request, but all the reference materials I find are full of jQuery examples. I can go through the jQuery source code, but I prefer a straightforward and simple example. I'm creat ...

The JSONP request failed with an error stating: ReferenceError: document is not defined

My internship project involves developing a mobile application based on the website www.claroline.net using Nativescript and Angular 2. I have successfully implemented the login function, allowing users to sign in to the app. Next, I need to integrate not ...

Issue encountered during retrieval of data from Steam marketplace

My goal is to retrieve the item price information for a single item on the steam market through a GET request. Below is the angularJS script I am currently using: <script> var app = angular.module('csgo', []); app.controller('MainCtr ...

Issue with jQuery Ajax not functioning properly across domains in Internet Explorer 9

I am facing an issue accessing a REST web service through jQuery. The Access-Control-Allow-Origin is correctly set to * as seen in Firebug, and Chrome/Firefox have no trouble accessing it. However, Internet Explorer seems to be causing trouble. I have gon ...

Referencing a JSON object

Here is a JSON list of search terms: [ "halo", [ "halo reach", "halo anniversary", "halo 4", "halo 3", "halo mega bloks", "halo 2", "halo sleepsack", "halo wars", "halo reach xbox 360", "halo combat evolved" ], ...

Comparing jquery ajax jsonp with angularjs $http json: A breakdown of two powerful ways

I have a scenario where I need to switch from using jquery to angularjs for a particular feature. Specifically, I am replacing jquery's ajax method with angularjs' $http method. This piece of code is responsible for enabling users to sign up for a mailchim ...

JSONP is unable to utilize data fetched from an external API

I attempted to run an ajax request in order to retrieve a collection of items and display them through logging: https://i.stack.imgur.com/IK1qy.jpg However, when checking the console, the items appear as undefined: https://i.stack.imgur.com/3WOCa.jpg O ...

Utilizing an ajax request in ClojureScript

I am a beginner in clojurescript and I want to further my understanding by converting a pre-existing application entirely into clojurescript. However, I am struggling with implementing an ajax call. Does anyone know of any online examples or could provid ...

Angular phone directory. JSONP callback

Exploring the Angular textbook on the official website, I came across the PhoneCat phone list extracted from a JSON file in the directory. I developed the server-side and deployed it to Heroku. The application generates valid JSON data. How can I send a ...

handling null data in a jquery ajax callback

I've been working with knockout.js to bind data and making jQuery ajax calls to a restful service that returns JSON data. I've tried multiple approaches but can't seem to figure out the correct syntax for the call. Every time the callback fi ...

Send your information to a JSONP endpoint

Can data be posted to JsonP instead of passing it in the querystring as a GET request? I have a large amount of data that needs to be sent to a cross-domain service, and sending it via the querystring is not feasible due to its size. What other alternati ...

Securely transmit data using a JQuery modal dialog form with HTTPS encryption

I currently have a functional modal login dialog. The only issue I'm facing is that when the original page is loaded through http, I still need to securely pass credentials to the server via https. Ideally, I would like to achieve this with minimal modific ...

The Relationship Between jQuery's .ajax Method and the Same Origin Policy

I have developed a functional HTML5/JS application intended for use in a vehicle, utilizing the network API provided by the vehicle manufacturer for get/post requests. Now, as I attempt to transition this app to run in a browser for a demonstration, I am ...

`json: Alert not displaying response data`

Currently, I am utilizing the following Ajax code to retrieve data from the server. $.get("http://***/umbraco/Api/SomeApi/SignIn",{apiVersion : 1,email:"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ee0efe3ebcee9e3efe7e2a0ed ...

Invalid label detected - Syntax Error in the response from Jsonp/Ajax!

I have a snippet of code that I'm having trouble with. It's shown below: <script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <script type="text/javascript"> jQuery.getJSON("http:// ...

"Troubleshooting tip: encountering a SyntaxError message stating 'import declarations may only appear at top level of a module'? Here's

After downloading fetch-jsonp by running npm i fetch-jsonp and adding its dependency to my package.json, I attempted to import it using the following code at the top of my main.js: import fetchJsonp from 'fetch-jsonp'; However, I kept encountering this e ...

Encountered an unforeseen issue: Unexpected character : within jQuery Ajax

After successfully setting up a REST web service in Java that delivers data in "application/json" format, I encountered an issue while attempting to access the REST data from my Windows machine using jQuery $.ajax. The web service is hosted on a separate L ...

How to use Javascript to fetch HTML content from an external website

Is it possible to access and retrieve scores from for a specific week using AJAX or JSON technology? Each game on the website seems to have a unique class which could make retrieving score information easier. Any guidance or assistance would be greatly ap ...

The failure of jQuery AJAX error callback to execute

I'm currently facing an issue with an AJAX call that I have in my code. Here's the code snippet: $.ajax({ type: "get", url: "xxx.xxx.xxx/xxx.js", dataType: 'jsonp', success: function(data) { console.log("suc ...