How to convert Base64 String to javascript file object like as from file input form?

Way 1: only works for dataURL, not for other types of url. function dataURLtoFile(dataurl, filename) { var arr = dataurl.split(‘,’), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); while(n–){ u8arr[n] = bstr.charCodeAt(n); } return new File([u8arr], filename, {type:mime}); } //Usage example: var file = dataURLtoFile(‘data:text/plain;base64,aGVsbG8gd29ybGQ=’,’hello.txt’); console.log(file); Way 2: works for … Read more

How to remove the arrows from input[type=”number”] in Opera [duplicate]

I’ve been using some simple CSS and it seems to remove them and work fine. input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; -moz-appearance: none; appearance: none; margin: 0; } <input type=”number” step=”0.01″/> This tutorial from CSS Tricks explains in detail & also shows how to style them

What is &amp used for

& is HTML for “Start of a character reference”. &amp; is the character reference for “An ampersand”. &current; is not a standard character reference and so is an error (browsers may try to perform error recovery but you should not depend on this). If you used a character reference for a real character (e.g. &trade;) … Read more

HTML5: Slider with two inputs possible?

I’ve been looking for a lightweight, dependency free dual slider for some time (it seemed crazy to import jQuery just for this) and there don’t seem to be many out there. I ended up modifying @Wildhoney’s code a bit and really like it. function getVals(){ // Get slider values var parent = this.parentNode; var slides … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)