Passing information to JScript

Results 1 to 2 of 2

Thread: Passing information to JScript

  1. #1
    Join Date
    Dec 1969

    Default Passing information to JScript

    I see I am the first question so I&#039ll make it an easy one: Is there a way to pass information to a JavaScript rather than using the onClick="functionname(&#039&#060;%=aspvariable&#03 9)"? Thanks in advance.<BR><BR>Brandon

  2. #2
    MikeD Guest

    Default RE: Passing information to JScript

    That depends on what you mean by passing information - to quote our great President - "What is &#039is&#039?"<BR><BR>If you want to put a server variable into client script that method works or you can set up a page scoped variable in your script that holds it in one place.<BR>&#060;script&#062;<BR> var strVariable = "&#060;%=aspvariable%&#062;";<BR>&#060;/script&#062;<BR>onclick="functionname(strVariable) "<BR><BR>If aspvariable is displayed somewhere in the html output you can access its value through the DOM. Say you put aspvariable&#039s value in a textbox with an ID/Name of "txtVar". You can code it as:<BR>onclick="functionname(txtVar.value)"<BR><BR >Hope this helps.<BR>

Posting Permissions

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