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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -