Skip to content

Instantly share code, notes, and snippets.

@rodneyrehm
Created July 16, 2014 13:43
Show Gist options
  • Save rodneyrehm/f8a613f137799fb0a18b to your computer and use it in GitHub Desktop.
Save rodneyrehm/f8a613f137799fb0a18b to your computer and use it in GitHub Desktop.
URI.js jQuery plugin: make $.ajax() accept URI instances
$.ajax = (function(ajax) {
return function(url) {
if (url instanceof URI) {
arguments[0] = arguments[0].toString();
}
return ajax.apply($, arguments);
};
})($.ajax);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment