Skip to content

Author: admin@master

Random color on different div’s

I have 3 div’s I want to give it a random color using javascript controlled css. Like this: The problem is that, it’s giving me the same color in every div. Any idea how can i solve this, I want to do it pure javascript and css no jquery if possible. Im still learning javascript. Thank you.. Answe…

Add ID to the preview div in Dropzone.js

I’m trying to add an id attribute to each file uploaded in Dropzone.js, So I can sort it later on. This is my code: The line Should add the id, but it does nothing. Tried it with prop() too. If I choose a different element, it does work fine. for example, this works for .dz-details But I cannot seem to

html2canvas not capturing image

html2canvas.js not capturing image. it leaves white space where the image occurs. I have tried a lot but i cannot find solution . Help is appreciated 🙂 Answer It works, when I host it in the server. The security restrictions causes it to fail.

How to check if an object is a Promise?

Whether it’s an ES6 Promise or a Bluebird Promise, Q Promise, etc. How do I test to see if a given object is a Promise? Answer How a promise library decides If it has a .then function – that’s the only standard promise libraries use. The Promises/A+ specification has a notion called thenable…