Can i add javascript in xml file where xml file has <svg> tag -
can use javascript in xml file has <svg>
tag. mean file name hello.xml
<?xml version="1.0" standalone="no"?>
please me on
thanks, pradeep
yes can, need wrap javascript in cdata section. example
<svg> <script> <![cdata[ function() { code........ } ]]> </script> </svg>
cdata (unparsed character data) required in case because javascript's < , & characters illegal in xml.
xml parser ignores inside cdata section.
Comments
Post a Comment