passing variable from Javascript to VBScript or AS

Results 1 to 2 of 2

Thread: passing variable from Javascript to VBScript or AS

  1. #1
    Join Date
    Dec 1969
    Posts
    5

    Default passing variable from Javascript to VBScript or AS

    how can i pass it?<BR><BR>1. Javascript --&#062; VBScript<BR>2. VBSCript --&#062; Javascript<BR>3. Javascript --&#062; ASP tag (&#060;%...%&#062;)<BR>4. ASP tab --&#062; Javascript<BR>5. VBScript --&#062; ASP tag<BR>6. ASP tag --&#062; VBScript<BR><BR>thank you

  2. #2
    Join Date
    Dec 1969
    Posts
    2,334

    Default first off...

    vbscript and javascript/jscript are script language you write in an ASP page.<BR>You will come across only two situations:<BR>JavaScript -&#062; VBScript and<BR>VBScript -&#062; JavaScript.<BR><BR>Look at the examples below:<BR><BR>passing a variable from javascript to vbscript--&#062;&#062;<BR>--------------------------------------------------<BR>&#060;html&#062;<BR>&#060;head&#062;<BR>&#060; title&#062;&#060;/title&#062;<BR>&#060;script language="javascript"&#062;<BR> var sTestVar=&#039;Test String&#039;;<BR><BR> function SetVar() {<BR> document.f1.sTest.value = sTestVar;<BR> }<BR>&#060;/script&#062;<BR>&#060;/head&#062;<BR>&#060;body&#062;<BR>&#060;% Response.Write Request.Form("sTest") %&#062;<BR>&#060;form name="f1" method="post" onSubmit="SetVar()"&#062;<BR>&#060;input type="hidden" name="sTest"&#062;<BR>&#060;input type="submit" name="Click Me"&#062;<BR>&#060;/form&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR>------------------------------------------------------<BR>passing a variable from vbscript to javascript--&#062;&#062;<BR>&#060;%<BR> Browser = Request.QueryString("Browser")<BR>%&#062;<BR> <BR> &#060;SCRIPT LANGUAGE="JavaScript"&#062; <BR> var BrowserType;<BR> BrowserType = "&#060;%=Browser%&#062;";<BR> <BR> switch(BrowserType)<BR> {<BR> case "MSIE":<BR> // IE browser-specific ...<BR> break;<BR><BR> case "NETSCAPE":<BR> // NS browser-specific ... <BR> break;<BR> }<BR> &#060;/SCRIPT&#062;<BR><BR><BR>Hope that helps,<BR><BR>~Roy

Posting Permissions

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