meadensitz
Programmer
<script type="text/javascript" >
function testMe() {
var xmld = "<account type='asset' id='create' name='modified expeses' counterWeight='debit' />";
var xmld1 = encodeURI(xmld);
var xmld2 = encodeURIComponent(xmld);
var xmld3 = escape(xmld);
abc = "<abc />";
abc1 = '<table border="0" width="100%" align="center" />';
var abc2 = "abc";
var abc3 = "attr='
alert(xmld1);
alert(xmld2);
alert(xmld3);
alert(abc);
alert(abc1);
alert(abc2);
alert(abc3);
}
</script>
...
I can't get a block of Javascipt to printout a string of XML. I have assume that the browser is treating it as a tag
inside of the html document - When I try to create a variable 'var abc2 = "<abc";', the browser (FF in this case) throws
a parsing error:
XML Parsing Error: not well-formed
Location: file:///C:/Projects/bookkeeping/webkell/webkell.xhtml
Line Number 117, Column 20: var abcz = "<abc";
----------------------------------------^
Does anyone know how I can manipulate XML strings in a browser <script type="text/javascript"> block?
Thanks in advance.
function testMe() {
var xmld = "<account type='asset' id='create' name='modified expeses' counterWeight='debit' />";
var xmld1 = encodeURI(xmld);
var xmld2 = encodeURIComponent(xmld);
var xmld3 = escape(xmld);
abc = "<abc />";
abc1 = '<table border="0" width="100%" align="center" />';
var abc2 = "abc";
var abc3 = "attr='
alert(xmld1);
alert(xmld2);
alert(xmld3);
alert(abc);
alert(abc1);
alert(abc2);
alert(abc3);
}
</script>
...
I can't get a block of Javascipt to printout a string of XML. I have assume that the browser is treating it as a tag
inside of the html document - When I try to create a variable 'var abc2 = "<abc";', the browser (FF in this case) throws
a parsing error:
XML Parsing Error: not well-formed
Location: file:///C:/Projects/bookkeeping/webkell/webkell.xhtml
Line Number 117, Column 20: var abcz = "<abc";
----------------------------------------^
Does anyone know how I can manipulate XML strings in a browser <script type="text/javascript"> block?
Thanks in advance.