Because the low-version Safari browser does not support the innerHTML method under SVG
And our mobile H5 page references the D3.js plugin, and D3 uses the innerHTML
Our solution is not to modify any of D3 's original code, to rewrite the innerHTML method
A small plugin was found on GitHub and can be easily modified to achieve
Https://github.com/phaistonian/SVGInnerHTML
We have modified the content to have these:
Modification 1: Increase the processing of the text node
constructors = [' svgsvgelement ', ' svgtextelement ']
Change 2: Add a separate write to the text
fn = function (to, node) {
Text
if (Node.nodetype = = 3) {
To.appendchild (node);
Return
}
Modification 3: Text writing and Tspan when commenting out
/*if (Node.nodename = = = ' TEXT ' | | node.nodename = = = ' Tspan ') {
Newnode.textcontent = node.innerhtml;
}*/
Safari does not support the solution of the SVG innerHTML method