Search⌘ K

Increasing the Reactiveness Using Operators

Learn about JSONP and the usage of the flatMap operator.

We'll cover the following...

What is JSONP?

JSONP, or JSON with padding, is a sneaky technique that web developers came up with to work around browser restrictions when requesting data from third-party domains.

JSONP bypasses these restrictions by loading external content with script tags, instead of the usual XMLHttpRequest. Adding a script tag to the DOM loads and executes its content directly, and the security restrictions are not applied.

The remote request’s content is, then, a normal JSON wrapped in a function call (the “P” in ...