Upload images to Imgur via JavaScript.
View demo here.
# Get the latest snapshot
$ git clone git@github.com:pinceladasdaweb/imgur.gitThe script depends on the following HTML markup:
<divclass="dropzone"></div>Add the following css before your </head> tag:
<linkhref="path/to/imgur.min.css" rel="stylesheet" media="screen">Add the following javascript before your </body> tag:
<scriptsrc="path/to/imgur.min.js"></script><script>varcallback=function(res){if(res.success===true){console.log(res.data.link);}};newImgur({clientid: 'xxxxxxxxxxxxxxxxx',callback: callback});</script>Loading Imgur via AMD (require.js):
<script>require(["path/to/imgur.min.js"],function(Imgur){varcallback=function(res){if(res.success===true){console.log(res.data.link);}};newImgur({clientid: 'xxxxxxxxxxxxxxxxx',callback: callback});});</script>The script expect the following values:
| Value | Description |
|---|---|
| clientid | Your Client-ID. Get here https://apidocs.imgur.com/ |
| callback | Calllback to run after the success upload |
##Browser Support
![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|
| IE 10+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
Check CONTRIBUTING.md for more information.
Check Releases for detailed changelog.




