M
mark4asp
What is the best way to avoid errors with characters > < & " ' using
javascript in xhtml files?
Does it depent upon the type of xhtml?
So for each of xhtml 1.0 transitional, xhtml 1.0 strict, xhtml 1.1
strict. How should I tell the browser that the special xml characters
For instance is this (below) correct for all of xhtml 1.0 transitional,
xhtml 1.0 strict, xhtml 1.1 strict, or is it correct for only some of
them?
<script type="text/javascript">
// <![CDATA[
var x = (z>0 && z<10) ? "blah" : "blah blah"
// ]]>
</script>
When I use an external javascript file:
<script type="text/javascript" src="js/browser.js"></script>,
presumably I can dispense with the <![CDATA[ ... ]]> ?
PS: Sometimes I'm not able to use an external javascript file.
javascript in xhtml files?
Does it depent upon the type of xhtml?
So for each of xhtml 1.0 transitional, xhtml 1.0 strict, xhtml 1.1
strict. How should I tell the browser that the special xml characters
appear as values) are to treated literally?< & " ' (for which xml mandates the use of entity values when they
For instance is this (below) correct for all of xhtml 1.0 transitional,
xhtml 1.0 strict, xhtml 1.1 strict, or is it correct for only some of
them?
<script type="text/javascript">
// <![CDATA[
var x = (z>0 && z<10) ? "blah" : "blah blah"
// ]]>
</script>
When I use an external javascript file:
<script type="text/javascript" src="js/browser.js"></script>,
presumably I can dispense with the <![CDATA[ ... ]]> ?
PS: Sometimes I'm not able to use an external javascript file.