Solved

Embed Javascript Within Vbscript

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Title # Comments Views Activity
PHP Web Development 6 71
Javascript question 8 44
Javascript Error 10 24
Switching ids and wanting to access array to output right value 6 21
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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

752 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