Solved

Embed Javascript Within Vbscript

Posted on 1998-10-26
5
521 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now