Solved

Embed Javascript Within Vbscript

Posted on 1998-10-26
5
612 Views
Last Modified: 2011-09-20
Can I embed Javascript Within Vbscript? Is there any statement to connect to remote database and display back the result.
0
Comment
Question by:vipin072998
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1272946
Not on the client.
Client based JavaScript (or vbscript) cannot access a remote database.
Serverbased scripts may do what they like and can be written in VBScript or JavaScript under IIS if that is your server.

Michel
0
 
LVL 28

Expert Comment

by:sybe
ID: 1272947
ASP example:
<%
Response.write "<script>alert('script in script')</script>"
%>

But the following gives an error (it's simply forbidden).

<script runat="server" language="vbscript>
Response.write "<script>alert('script in script')</script>"
</script>

But of course the error can easily be avoided:

<script runat="server" language="vbscript>
Response.write "<scri" & "pt>alert('script in script')</script>"
</script>


0
 
LVL 28

Expert Comment

by:sybe
ID: 1272948
ASP example:
<%
Response.write "<script>alert('script in script')</script>"
%>

But the following gives an error (it's simply forbidden).

<script runat="server" language="vbscript">
Response.write "<script>alert('script in script')</script>"
</script>

But of course the error can easily be avoided:

<script runat="server" language="vbscript">
Response.write "<scri" & "pt>alert('script in script')</script>"
</script>


0
 

Author Comment

by:vipin072998
ID: 1272949
Dear Sybe,
I have tried this code but its not working.The following Error is Generated

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/test/default.asp, line 14

Response.write "<scri" & "pt>alert('script in script')
although statement is like
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/test/default.asp, line 14

Response.write "<scri" & "pt>alert('script in script')"
Please check and try it out, I have tried it every way

0
 
LVL 28

Accepted Solution

by:
sybe earned 50 total points
ID: 1272950
You are right, but these  work

<script language="VBScript" RUNAT="Server">
Response.write "<scri" & "pt>alert('script in script')</scr" & "ipt>"
</script>

<%
Response.write "<script>alert('script in script')</script>"
%>
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question