ZZZ
|
| Posted: 01/13/2003, 1:27 AM |
|
I am trying to use javascriptwith asp every thing works fine except when i add
something like this
<script language="javascript1.2">
test('event_desc');
</script>
the page breaks right after ' qoute (since that means comments)
is it possible to show ' in asp without breaking the code
i would greatly appreciate any help i am new to asp programming
|
|
|
 |
che
|
| Posted: 01/13/2003, 10:14 AM |
|
Trying using double quotes. I could be wrong but I think they are inter-changeable in most cases. I know in the example below you could use single or double quotes but double works in ASP code.
By using double double qoutes ("") you get the effect of a single quote. Check the code below
Example below uses the ASP object Response.Write. In this cause what is being written to the browser needs to be in quotes.
The &vbcrlf at the end of the Response.Write lines are vb carriage return and line feeds. This is just for formating the text your browser receives so its readable by humans. It breaks the text like hitting the Enter button would in a code editor.
Happy coding.
<%@ Language=VBScript%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<%
Response.Write "<script type=""text/javascript"">" &vbcrlf
Response.Write "function myfunction(){" &vbcrlf
Response.Write "alert(""HELLO"")" &vbcrlf & "}" &vbcrlf
Response.Write "</script>" &vbcrlf
%>
</HEAD>
<BODY LANGUAGE=javascript onload="myfunction()">
<P> </P>
</BODY>
</HTML>
|
|
|
 |
bill
|
| Posted: 01/13/2003, 3:45 PM |
|
<script language=\"javascript1.2\">
test('event_desc');
</script>
|
|
|
 |
|