I have an AJAX call getting info out of the Github API. It is returned in base64 encoding but when i try to decode it I get the aforementioned error.
Has anyone run
atob breaks due to the newlines in the response. Remove them to get your code to work:
function addSVGToPage(SVGToAdd) {
var entry, decodedEntry; // <-- What is this doing here? It's unused.
makeAJAXCall(SVGToAdd, function (returnedJSON) {
console.info(window.atob(returnedJSON.data.content.replace(/\s/g, '')));
// ^^^^^^^^^^^^^^^^^^^
});
}