public static void setInnerSvg ( Element element , String svg ) { if ( Dom . isFireFox ( ) ) { setFireFoxInnerHTML ( element , "<g xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" + svg + "</g>" ) ; } else if ( Dom . isWebkit ( ) ) { setWebkitInnerHTML ( element , "<g xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" + svg + "</g>" ) ; } }
Similar method to the setInnerHTML but specified for setting SVG . Using the regular setInnerHTML it is not possible to set a string of SVG on an object . This method can do that . On the other hand this method is better not used for setting normal HTML as an element s innerHTML .