...

View Full Version : J(ava)Script inside of VBScript?



RadarBob
08-05-2002, 04:13 PM
I want to add some javascript code in-line with existing server-side code. Can anyone show me the correct the combo of ASP tags, etc.?

I've tried the following, which doesn't work:


<%LANGUAGE="VBSCRIPT"%>

..................

<%
......... vbscript and ASP stuff ....

<script language="Javascript" RUNAT=SERVER>
........ javascript code using a recordset object.........
</script>

..... continue w/ vbscript and ASP stuff

%>


and



<%LANGUAGE="VBSCRIPT"%>

...............

<%

.......... vbscript and ASP stuff
%>
<%
<script language="Javascript" RUNAT=SERVER>
........ javascript code using a recordset object.........
</script>
%>

<%
......... continue w/ bvscript and ASP stuff

%>


and also without any ASP tags or the <script> tag - which I knew wouldn't work; and it didn't.

allida77
08-05-2002, 06:02 PM
You can not put the <script language="Javascript" RUNAT=SERVER> tags within the asp without doing
<%
Response.Write("<script language="Javascript" RUNAT=SERVER>")
%>

whammy
08-08-2002, 01:29 AM
If you close the asp delimiters you can put the javascript anywhere since it's run on the server side:


<% @Language="VBScript"%>
<script language="javascript" runat="server">
// code here
</script>

<% 'More ASP code here! %>

Then it should work... works for me.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum