Simple Question --- Javascript

Results 1 to 2 of 2

Thread: Simple Question --- Javascript

  1. #1
    Vipul Desai Guest

    Default Simple Question --- Javascript

    I have a question about Javascript. I am a VB script programmer who is now learning Javascript. The question I have is can I still use stuff like Session Level Variables and so on within <BR>ASP technology.<BR><BR>Thanks,<BR><BR>Vipul

  2. #2
    Ben Timby Guest

    Default RE: Simple Question --- Javascript

    If you are using JavaScript on the server-side, yes, you can. However, if you are writing client side JavaScript, you cannot access server-side variables such as session vars from JavaScript directly. You can however do something like this:<BR><BR>Response.Write("&#060;SCRIPT Language=&#039JavaScript&#039")<BR>Response.Write( "&#060;!--")<BR>Response.Write("var menu2 = new Array(" & Session("Value1") & ", " & Session("Value2") & ")")<BR>Response.Write("--&#062;")<BR>Response.Write("&#060;/SCRIPT&#062;")<BR><BR>To write the server-side variables to the client-side script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts