views:

102

answers:

1

Which is better? To use Ecmascript inside your SVG which is embedded in XHTML sent as application/xhtml+xml or to use Javascript (ecmascript) inside the XHTML within which the SVG to be manipulated is embedded?

It feels better to use it inside the SVG, but that's just me. Is there any actual value in any of the methods or are they the same?

EDIT: The only content in the XHTML is the SVG

Thanks

+1  A: 

If you copy and pasted the SVG into another document, would you want the script to go with it? If so, putting it inside the SVG would make more sense, and vice versa.

Alohci