Solved

Embed Javascript Within Vbscript

Posted on 1998-10-26
5
572 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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'…
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…

830 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