Skip to content

Instantly share code, notes, and snippets.

View theseyi's full-sized avatar
💭
making the world's data actionable

Seyi Adebajo theseyi

💭
making the world's data actionable
  • Metaphor Data
View GitHub Profile
@theseyi
theseyi / json.md
Last active August 29, 2015 14:09 — forked from tmcw/json.md

Moral Concerns

JSONP is not actually JSON with padding, it's Javascript code that's executed. JSON is not a real subset of Javascript and the way it is not is important to us: via UTFGrid, we are all UTF-8 masters.

JSONP is not safe: it's Javascript that's executed. It's trivial to XSS with JSONP, because JSONP is XSS. Just have a call like mapbox.load('foo.tilejson', …) and if foo.tilejson gets replaced with destroyYoursite(), it gets run. Compare to JSON.parse, which is, on purpose, not eval.

Practical Concerns

JSONP is questionable in terms of performance. To be fast, you want to have the same callback all the time so that you can cache the response. But this leads to a page like

@theseyi
theseyi / demo.html
Created September 17, 2013 00:28 — forked from dciccale/demo.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Styling radios &amp; checkboxes using CSS3</title>
<link rel="stylesheet" media="screen" href="styles.css" >
</head>
<body>
<h1>Styling radios &amp; checkboxes using CSS3</h1>