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
// Takes a URL, param name, and data string | |
// Sends to the server.. The server can respond with binary data to download | |
jQuery.download = function(url, key, data){ | |
// Build a form | |
var form = $('<form></form>').attr('action', url).attr('method', 'post'); | |
// Add the one key/value | |
form.append($("<input></input>").attr('type', 'hidden').attr('name', key).attr('value', data)); | |
//send request | |
form.appendTo('body').submit().remove(); |