javascript syntax error

B

barry

Hi I have the following code in a code behind file

Dim sString As System.Text.StringBuilder
sString = New System.Text.StringBuilder
sString.Append("<script language=""Javascript"">" & vbCrLf)
sString.Append("<img src=""ck.gif"">" & vbCrLf)
sString.Append("</script>")

If (Not Me.IsStartupScriptRegistered("MyInitt")) Then
Me.RegisterStartupScript("MyInitt", sString.ToString)
End If

This gives me a syntax error in the following line
sString.Append("<""ck.gif"">" & vbCrLf)

this is what the code looks like after it is parsed
<script language="Javascript">
<img src="ck.gif">
</script>

any help as to what is causing the syntax error would be appreciated.
 
M

m.posseth

well

this
<script language="Javascript">
<img src="ck.gif">
</script>

is not valid Javascript / Jscript syntax

you are putting a HTML tag between script blocks :-| ????

maybe you would better tell what it is you want to acomplish

regards

Michel Posseth [MCP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top