Search code examples
javascriptjquerydownloadimageon-the-fly

Download img created on the fly


I create img element with a jquery plugin.

I would like to be able to click a button element and dowload the img element.

Is it possible without HTML5?

I do not store the image, cause it is created on the fly by jquery.

i'm using this plugin to create the img: http://www.class.pm/files/jquery/jquery.uqr/demo/


Solution

  • Since this is from a different domain, you won't be able to access image contents, unless you try to use CORS - and even then, there's very limited browser support. Use this plugin instead and then use toDataURL() to save it.