Response.write vs Document.write

16,274

You can use VBScript or JScript as your language when writing classic ASP server-side code.

From Wikipedia:

JScript is Microsoft's implementation of the ECMAScript standard that is used in Microsoft's Internet Explorer.

You can also use it in classic ASP, and it has some additional objects available (Response, Request, Application, Session, etc) so that you can do server-side web programming.

If I was required to write classic ASP, I would definitely choose JScript. Each language has its own syntax requirements that you will need to learn whichever you choose.

document.write() is not used server-side to send data back to the client, you always use the Response object for that.

If I'm writing classic asp using JScript (and not VBScript), should everything inside <% %>be considered javascript, just on the server side?

Depends on the context—generally the syntax is the same. Stick with Microsoft's JScript documentation and you'll be fine.

Share:
16,274
user798719
Author by

user798719

Some questions may end up being dumb, but if I ask it, it's not dumb to me.

Updated on June 04, 2022

Comments

  • user798719
    user798719 almost 2 years

    Inside a classic asp page, I'm told that you can use vbscript or jscript. And jscript is just javascript.

    So I'm not sure what the difference is between Response.Write, Response.Write(), response.write(), and document.write()

    Does the capitalization matter, and sometimes I seem to see no parentheses after the method name, and sometimes I do. It's all devolving into a mess inside my newbie head.

    If I'm writing classic asp using JScript (and not VBScript), should everything inside <% %> be considered javascript, just on the server side?

    Prior to classic asp, I was sure that javascript was a client-side scripting language only.

  • jeremysawesome
    jeremysawesome about 12 years
    There actually are ways to run javascript on the server... it's just a programming language. codeproject.com/Articles/4271/…
  • Tim M.
    Tim M. about 12 years
    ASP is not its own language. JavaScript can be executed anywhere that there is a compatible interpreter (including class ASP).
  • D'Arcy Rittich
    D'Arcy Rittich about 12 years
    -1: ASP is not a language. The languages are VBScript and JScript, the latter which you seem unaware of.