Created
October 3, 2011 01:07
-
-
Save walter/1258224 to your computer and use it in GitHub Desktop.
Snippet from media_selector.js that fails in Firefox on ajax call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this gives selected result and the user's selected size | |
// and outputs end result of oembed request for html to embed the result at the selected size | |
this.get('#/selections/:id', function(context) { | |
$('#result-description-and-sizes').fadeOut(); | |
$('#page-spinner').fadeIn(); | |
// params['id'] decodes to normal url, but we need escaped version | |
var oembedUrl = this.params['id']; | |
$.get(oembedUrl) | |
.success(function(response) { | |
// TODO: make this detect xml or json and parse accordingly | |
// TODO: this is limited to same domain only for now, update to handle JSONP | |
// probably need to switch to $.ajax and more complete parameters call for jsonp | |
var selectionFromResponse = $.parseJSON(response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment