Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
more semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Nov 7, 2012
1 parent febbdd3 commit 261b5f6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "jsonp",
"homepage": "http://jsonp.jit.su",
"description": "A simple JSONP proxy",
"version": "0.0.0-28",
"version": "0.0.0-29",
"repository": {
"type": "git",
"url": "https://github.com/afeld/jsonp.git"
Expand Down
3 changes: 1 addition & 2 deletions public/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ code {
.urlEntry input {
padding: 0.5em;
}
#footer {
padding: 1em;
footer {
text-align: center;
}
21 changes: 12 additions & 9 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,21 @@

<hr/>

<p>
Unfortunately, detection of response errors with JSONP is difficult, at best. jQuery's JSONP implementation won't call an error callback unless an explicit timeout is specified - see <a href="http://stackoverflow.com/questions/5247295/jquery-ajax-request-using-jsonp-error">here</a> for more info and options.
</p>
<p>
CORS, however, is just normal AJAX! There is also a security advantage, in that it's not possible for a malicious service (including this one) to run arbirtrary JavaScript on your page.
</p>
<section>
<h2>CORS vs. JSONP</h2>
<p>
Unfortunately, detection of response errors with JSONP is difficult, at best. jQuery's JSONP implementation won't call an error callback unless an explicit timeout is specified (which the <a href="#client">plugin</a> takes care of) - see <a href="http://stackoverflow.com/questions/5247295/jquery-ajax-request-using-jsonp-error">here</a> for more info and options.
</p>
<p>
CORS, however, is just normal AJAX! There is also a security advantage, in that it's not possible for a malicious service (including this one) to run arbirtrary JavaScript on your page.
</p>

<hr/>
<hr/>
</section>

<div id="footer">
<footer>
<a href="https://twitter.com/aidanfeldman" class="twitter-follow-button" data-show-count="false">Follow @aidanfeldman</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</footer>
</body>
</html>

0 comments on commit 261b5f6

Please sign in to comment.