This is a Wrapper for Imgur to upload images easily!
- Firstly, Get a Client Id from Imgur Check this out
- Create an Input element with
type="file"attribute and any selector, eg. id:#imgur
<input type="file" id="imgur">
- Use the Class
Imgur(<client-id>, <input-selector>, <callback)>)with the parameters
| Parameter | Description | Example | Required |
|---|---|---|---|
| Client ID | Your Imgur API Client ID | "79b8XXXXXXXXff6" | YES |
| Input Selector | The css selector of your input element | "#input" | YES |
| Callback | Callback Function which has the Link and other data of the image | console.log | NO |
...
<body>
<input type="file" id="#imgur">
<script src="/path/to/script/script.js"></script>
<script>
new Imgur("79b89d2f1266ff6", "#imgur", console.log)
</script>
</body>
...