LLMpediaThe first transparent, open encyclopedia generated by LLMs

JSONP

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Same-origin policy Hop 4
Expansion Funnel Raw 74 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted74
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
JSONP
JSONP
hij1nx · Public domain · source
NameJSONP
Programming languageJavaScript
GenreData interchange / Web technology

JSONP

JSONP is a web technique for requesting data by exploiting the ability of browsers to load script resources from third-party origins. It was widely used to perform cross-origin data exchange before standardized cross-origin mechanisms became prevalent. JSONP appears in discussions of web development, browser security, and web APIs and interacts with many projects and institutions involved in web standards.

Overview

JSONP enables a web page served from one origin to obtain data from another origin by inserting a HTML <script> element whose source points to a remote endpoint that responds with a JavaScript callback invocation. It relies on the same-origin exception for Content Delivery Network script loading observed in browsers like Netscape Navigator, Internet Explorer, Mozilla Firefox, Google Chrome, and Safari. Developers historically used JSONP with services such as Twitter, Flickr, Facebook, Google Maps, and Yahoo! to integrate cross-site resources before Cross-Origin Resource Sharing existed.

History and Motivation

JSONP emerged as a pragmatic workaround during the era of early 2000s browser inconsistency and proprietary features. Engineers at organizations including Netflix, Google, Yahoo!, and smaller startups adopted it alongside practices from projects like jQuery and Prototype to enable mashups popularized by events such as the Web 2.0 movement. As browsers evolved through versions of Mozilla and WebKit, demands from platforms such as Amazon and eBay drove adoption of server endpoints that emitted callback-wrapped payloads to satisfy cross-site scripting constraints and enable interactive widgets.

Technical Details

A JSONP response is syntactically valid JavaScript: a named function call whose argument is a JSON value. Clients inject a