Код: Выделить всё
// Create element of the SVG
var objElement = document.createElement('object');
objElement.setAttribute('type',"image/svg+xml");
// Assume $rootScope.b64 contains the base64 data of the SVG
objElement.setAttribute('data', $rootScope.b64);
// Append the inside the DOM's body
angular.element(document.body).append(objElement);
console.log(objElement);
console.log(objElement.getSVGDocument());
console.log(objElement.contentDocument);
содержит полную строку данных Base64 (B64)).
Код: Выделить всё
#document
Код: Выделить всё
#document
< /code>
Почему я не могу получить элемент SVG? Как я могу правильно получить элемент SVG? Я уже изучил многие статьи, и я просто не могу получить элемент Подробнее здесь: https://stackoverflow.com/questions/333 ... javascript
Мобильная версия