- From: Amit Rekhi <amit@abinfosys.com>
- Date: Wed, 5 Aug 1998 14:27:05 +0530
- To: "Style List" <www-style@w3.org>
Hello, I have 2 code snippets and they have put me in doubt as to how char. entity refrences are processed! CODE SNIPPET 1 . . . <HTML> <HEAD> <SCRIPT LANGUAGE="JSCRIPT"><![CDATA[ function Temp() { var try = "&""; alert(try); } ]]></SCRIPT> <TITLE>XSL GENERATED OUTPUT</TITLE> </HEAD> <BODY> <FORM name="ProductForm" OnSubmit="Temp()"> <INPUT type="submit" value="SUBMIT FORM"/> <INPUT type="reset" value="CLEAR FORM"/> </FORM> </BODY> </HTML> . . . * When temp() is invoked on form submission, I get a dialog box showing me "&"" as it is.The text is not replaced by "(double quotes).WHY? But in code snippet 2, " gets properly substituted by "(double quotes) when it is stored in the file temp.txt. CODE SNIPPET 2 . . . <HTML> <FORM name="ProductForm" OnSubmit=" var NewFile = new ActiveXObject('Scripting.FileSystemObject'); var Response = NewFile.CreateTextFile(document.all.filename.value,true); var text = '"'; Response.Write(text); Response.Close();"> <INPUT type="filename" value="c:\temp.txt"/> <INPUT type="submit" value="SUBMIT FORM"/> </FORM> </BODY> </HTML> . . . Why is it that in CODE SNIPPET 1 the entitry refrence does not get replaced whereas it does in the second case? Thanks for any suggestions, AMIT
Received on Wednesday, 5 August 1998 05:28:56 UTC