server side vbscript /javascript question 
Author Message
 server side vbscript /javascript question

http://www.*-*-*.com/ +side+VBScript+variables&hl=e...
e=UTF-8&oe=UTF-8&selm=OocestDmAHA.2232%40tkmsftngp05&rnum=1

will this code work as
myServerSideVariable is declared on server side vbscript

and  is read within javascript client side codes as

var myvar = <%=myServerSideVariable%>

and can be displayed

window.alert(myvar)

i'm trying something like this and it does not seem to work.

alert is displaying undefined.
any ideas?
tia,
dk



Sun, 26 Dec 2004 04:30:41 GMT  
 server side vbscript /javascript question

var myvar = <%=myServerSideNumericVariable%>
var myvar = '<%=myServerSideStringVariable%>'

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sun, 26 Dec 2004 04:54:40 GMT  
 server side vbscript /javascript question
single or double quotes around the variable in javascript does not seem
to work either. is that what you were trying ?

tia,
dk

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 26 Dec 2004 05:13:36 GMT  
 server side vbscript /javascript question

Quote:

> single or double quotes around the variable in javascript does not
> seem to work either. is that what you were trying ?

This simple ASP page works fine for me...

<html>
<body>
<%
myServerSideNumericVariable = 99
myServerSideStringVariable = "ninety-nine"
%>
<pre style='font:x-small courier new'>
<script language="javascript">
var myNumericVar = <%=myServerSideNumericVariable%>
var myStringVar = '<%=myServerSideStringVariable%>'
document.writeln(myNumericVar);
document.writeln(myStringVar);
</script>
</pre>
</body>
</html>

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sun, 26 Dec 2004 05:28:09 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. pass server side vbscript to client side javascript

2. Calling client-side javascript function from server-side vbscript

3. Calling client-side javascript from server-side vbscript

4. dumb question - fundamentals of client-side vs server-side vbscript

5. Calling Server Side JScript from Server Side VBScript

6. How do I call a VBScript-function from JavaScript in ASP (both server-side)

7. Client-side VBScript and Server-side VBScript?

8. Mixing server side Javascript and VBScript

9. ASP/server side vbscript security question

10. Mixed client side VBScript & Javascript not working

11. sending variants from VBscript to JavaScript (client side)

12. Client Side Scripting - VBScript or JavaScript?

 

 
Powered by phpBB® Forum Software