Specification says
data:[<mime type>][;charset=<charset>][;base64],<encoded data>
Considering this it is easy to split the uri after "," to retrieve the image data. Is there a built in function for the same in javascript or jquery ?
Specification says
data:[<mime type>][;charset=<charset>][;base64],<encoded data>
Considering this it is easy to split the uri after "," to retrieve the image data. Is there a built in function for the same in javascript or jquery ?
you could use replace(/^data:image\/(png|jpg);base64,/, '')
for example
var encodedData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAYAAADdRIy+AAAB0UlE';
encodedData = encodedData.replace(/^data:image\/(png|jpg);base64,/, '');