JSJaC
JSJaC copied to clipboard
buildNode creates "-1" on some non-string values in IE
buildNode() accepts a map of keys and values. If one of these values is the Boolean value true, it becomes "-1" rather than the string "true" in the final packet, but only in Internet Explorer - specifically IE 8. Here's a small code sample:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="lib/jsjac-1.3.4/jsjac.uncompressed.js"></script>
</head>
<body>
<div id="content">TODO write content</div>
<script type="text/javascript">
var msg = new JSJaCMessage();
msg.setBody('foo');
msg.appendNode(msg.buildNode('bar', { isBar: true, 'baz': 'quux' }));
document.getElementById('content').innerText = msg.xml();
alert(msg.xml());
</script>
</body>
</html>
don't think it makes sense after all to accept non string values here at all, should I add a check for it?