Skip to content

Instantly share code, notes, and snippets.

@walter
Created October 3, 2011 01:07
Show Gist options
  • Save walter/1258224 to your computer and use it in GitHub Desktop.
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 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