When tried to convert to base64 from url - getting CORS Issue in JS
问题 when i tried to convert image url to base64 am getting CORS issue. Not sure what exactly need to do to get rid of this CORS issue my code look like this function toDataURL(url, callback) { var xhr = new XMLHttpRequest(); xhr.onload = function() { var reader = new FileReader(); reader.onloadend = function() { callback(reader.result); } reader.readAsDataURL(xhr.response); }; xhr.open('GET', url); xhr.responseType = 'blob'; xhr.send(); } toDataURL('https://www.dropbox.com/******/gradient-test