Forum Moderators: open

Message Too Old, No Replies

Breaking down the javascript keyword

What about the <script tag?

         

dnimrodx

3:45 pm on Mar 2, 2005 (gmt 0)

10+ Year Member



Hello,

I was wondering as to whether this is legal:

[pre]Response.Write('<script type="text/javas' + 'cript" src="src/cli/lvemail.js" defer></script>');[/pre]

Also:
- why does one have to break down the javascript in the string?
- and what about the script tag (<script...)? Could that not be misunderstood by a browser?

Thanks,

Dave

Iguana

3:56 pm on Mar 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Response.Write is an ASP command and I think you will find that you will need to use Response.Write("...") - rather than single quotes, to get it to work.

There's no reason to split up the word Javascript or script on the Server Side. You seem to be mixing up what you have to do in client-side Javascript when you use document.write and there you have to split the script tag up because the browser tries to interpret it as the start of a script block.

dnimrodx

4:27 pm on Mar 2, 2005 (gmt 0)

10+ Year Member



I think you will find that you will need to use Response.Write("...")

Not if you are coding in Javascript and NOT VBScript:

[pre]<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>[/pre]

and there you have to split the script tag up because the browser tries to interpret it as the start of a script block.

So the <script... tag is the problem then?

Thank you very much.

Dave