Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-05-2002, 03:13 PM   PM User | #1
RadarBob
Regular Coder

 
Join Date: Jun 2002
Location: Round Rock, Texas
Posts: 443
Thanks: 0
Thanked 0 Times in 0 Posts
RadarBob is an unknown quantity at this point
Question J(ava)Script inside of VBScript?

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:
Code:
<%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

Code:
<%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.
RadarBob is offline   Reply With Quote
Old 08-05-2002, 05:02 PM   PM User | #2
allida77
Regular Coder

 
Join Date: Jun 2002
Location: Cincinnati, OH
Posts: 545
Thanks: 0
Thanked 0 Times in 0 Posts
allida77 is an unknown quantity at this point
You can not put the <script language="Javascript" RUNAT=SERVER> tags within the asp without doing
<%
Response.Write("<script language="Javascript" RUNAT=SERVER>")
%>

Last edited by whammy; 08-08-2002 at 12:32 AM..
allida77 is offline   Reply With Quote
Old 08-08-2002, 12:29 AM   PM User | #3
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
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.
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)

Last edited by whammy; 08-08-2002 at 12:33 AM..
whammy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:02 PM.


Advertisement
Log in to turn off these ads.