Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Create instance of ASP JS function in ASP VBS

Posted on 2004-09-02
2
Medium Priority
?
205 Views
Last Modified: 2008-02-20
okay, I have a server-side asp javascript "class":

function Graphic(){
  ...
}

I'm trying to figure out how to create a new instance of it in asp vbs.  I can create an instance in javascript easily enough: "var whatever = new Graphic();", but it's annoying to type:

%><script language="Javascript" runat="server">var whatever = new Graphic();</script><%

every time I want a new instance of the object.

thx
0
Comment
Question by:cwolves
[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
2 Comments
 
LVL 4

Accepted Solution

by:
chipple earned 1000 total points
ID: 11970440
You will have to create the instance in JScript and pass it back to VBScript.
You can make a JScript function for this purpose.
The reason it doesn't work directly is that VBScript doesn't understand JScript's classes.

<script language="Javascript" runat="server">

function Graphic() {
  this.hello = "hello!";
}

function CreateGraphicVB() {
  return new Graphic();
}

</script><%

Dim whatever
Set whatever = CreateGraphicVB()
Response.Write whatever.hello

%>

Good luck.
0
 
LVL 9

Author Comment

by:cwolves
ID: 11973466
thx  :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

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