Server side variables to client side script? 
Author Message
 Server side variables to client side script?

hi,

Can anyone show me the syntax to passing serverside variables to client side
script? (VBScript)

Thankyou

Jim



Wed, 05 Nov 2003 04:30:29 GMT  
 Server side variables to client side script?
Jim says:

Quote:
>Can anyone show me the syntax to passing serverside variables to client side
>script? (vbscript)

You have to create them in the client-side code, and populate them all
from the server-side code.

----------
Randy Hunt
MCP+I / MCSE

Please visit my sites!
http://www.wshscripting.com
http://www.serverscripting.com



Wed, 05 Nov 2003 05:22:01 GMT  
 Server side variables to client side script?
Thanks Randy but could you show me a quick example ?

Thanks in advance.

Jim



Quote:
> Jim says:

> >Can anyone show me the syntax to passing serverside variables to client
side
> >script? (vbscript)

> You have to create them in the client-side code, and populate them all
> from the server-side code.

> ----------
> Randy Hunt
> MCP+I / MCSE

> Please visit my sites!
> http://www.wshscripting.com
> http://www.serverscripting.com



Wed, 05 Nov 2003 05:26:27 GMT  
 Server side variables to client side script?
Jim says:

Quote:
>Thanks Randy but could you show me a quick example ?

Depends on what you've got and where your trying to get it.
Post your code, and and explanation of what you want to happen, and
I'll see if I can help you.

----------
Randy Hunt
MCP+I / MCSE

Please visit my sites!
http://www.wshscripting.com
http://www.serverscripting.com



Wed, 05 Nov 2003 07:43:55 GMT  
 Server side variables to client side script?
Plain exampe of using a serverside variable in client script as I would do
it:

<%
Dim MyVar
MyVar = "SomeThing"

Response.Write("<script language='VBScript" & vbCrLf)
Response.Write("<!--" & vbCrLf)
Response.Write(" Sub MySub()" & vbCrLf)
Response.Write("If " & MyVal & " <>"" Then" & vbCrLf)
Response.Write("   ' Do something" & vbCrLf)
Response.Write("End If" & vbCrLf)
Response.Write("End Sub" & vbCrLf)
Response.Write("-->" vbCrLf)
Response.Write("</script>")
%>

Jim Teeuwen


Quote:
> hi,

> Can anyone show me the syntax to passing serverside variables to client
side
> script? (vbscript)

> Thankyou

> Jim



Wed, 05 Nov 2003 09:29:43 GMT  
 Server side variables to client side script?

Basically just put your server-side variables in <%= and %> when defining your client-side ones.

Example

<%
'Define your server-side vars here
Dim ServerVar
ServerVar = "Hello, Jim!"
%>

<script language="VBScript">
'Define your client-side vars to recieve your server-side ones
Dim ClientVar 'this will equal MyVar
ClientVar = <%=ServerVar%>
MsgBox ClientVar
</script>

--
---------------------
mushhead (name changed to protect innocent parties :o)
---------------------
chocoba65 at hotmail dot com
---------------------

  hi,

  Can anyone show me the syntax to passing serverside variables to client side
  script? (vbscript)

  Thankyou

  Jim



Wed, 05 Nov 2003 09:48:14 GMT  
 Server side variables to client side script?

Many thanks all, I have got it now ;-)

Jim

  Basically just put your server-side variables in <%= and %> when defining your client-side ones.

  Example

  <%
  'Define your server-side vars here
  Dim ServerVar
  ServerVar = "Hello, Jim!"
  %>

  <script language="VBScript">
  'Define your client-side vars to recieve your server-side ones
  Dim ClientVar 'this will equal MyVar
  ClientVar = <%=ServerVar%>
  MsgBox ClientVar
  </script>

  --
  ---------------------
  mushhead (name changed to protect innocent parties :o)
  ---------------------
  chocoba65 at hotmail dot com
  ---------------------

    hi,

    Can anyone show me the syntax to passing serverside variables to client side
    script? (vbscript)

    Thankyou

    Jim



Wed, 05 Nov 2003 17:42:23 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. ASP referring to server side variables in client side script

2. Client side and Server side script working together

3. Uh ? Client side and Server side variables

4. Client-side to Server-side variable?

5. Passing variables from server-side to client-side

6. Passing variables from client-side to server-side

7. Passing variable from server side to client side

8. Client side scripting / server side scripting

9. Accessing Data generated with client-side script from server-side script

10. Calling Server Side Script from Client Side Script

11. Call Server Side Script From Client Side Script

12. Client side scripting / server side scripting

 

 
Powered by phpBB® Forum Software