How would I insert some JavaScript code into a block of ASP code? i.e. to do it the other way round you would put:
var somejavascriptvariable = <%= someasp %>;
any help?
How would I insert some JavaScript code into a block of ASP code? i.e. to do it the other way round you would put:
var somejavascriptvariable = <%= someasp %>;
any help?
It would help if you provided some code to show us exactly what you're trying to do. Are you talking about client side javascript here as per Westie's comment? If you're using classic asp to output js then you can always put it in a response.write statement, but the syntax would be horrible, given that you would probably have loads of double quotes to escape.
You can use JavaScript as your server side scripting language in place of VBScript. There are two ways of doing this. If you start a page with the line
<%@language="javascript"%>
Then you can use js within your <% %> tags instead of vbs.
Alternatively you can use it in a page which mainly uses vbs as follows, note the use of runat="server"
<%@language="VBScript"%>
<html>
<head>
<script type="text/javascript" language="javascript" runat="server">
var HelloWorld = "hello world";
</script>
<title>Title</title>
</head>
<body>
<%= HelloWorld %>
</body>
</html>>