?
Solved

Shared Libraries with ASP / WSH

Posted on 2003-02-26
9
Medium Priority
?
336 Views
Last Modified: 2006-11-17
I'm developing a library of JavaScript functions (could just as easily be VBScript).  Right now, they're in a file called lib.js that can be included in a WSH .wsf file via the SCRIPT tag.

If I convert lib.js file to lib.asp by adding SCRIPT tags within the file itself, I can include lib.asp in other ASP scripts (but then I can no longer use it with WSH).

I hate the thought of manually keeping these two files in sync.  While I could write a short script to add the necessary wrapper around the .js file, that's an ugly hack at best.  How can I combine lib.js & lib.asp into ONE file that can be included from BOTH ASP and WSH?
0
Comment
Question by:djschaap
[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
  • 5
  • 4
9 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 8026235
i never tried this, but create 2 files for include with asp, with just the tags.

===========
file starttag.inc
===========
<%
===========

===========
file endtag.inc
===========
%>
===========

then in asp include like this:
<!--#include file="starttag.inc"-->
<!--#include file="yourlib.asp"-->
<!--#include file="endtag.inc"-->
0
 
LVL 1

Author Comment

by:djschaap
ID: 8026347
Nice thought, but:

using <%  %> tags:
Active Server Pages, ASP 0116 (0x80004005)
The Script block lacks the close of script tag (%>).
/.../start.inc, line 1

using SCRIPT tags:
Active Server Pages, ASP 0117 (0x80004005)
The Script block lacks the close of script tag (</SCRIPT>) or close of tag symbol (>).
/.../start.inc, line 1


Thanks for trying!
0
 
LVL 28

Expert Comment

by:sybe
ID: 8026412
and what about using the html <script> tag in your asp:

<script scr="yourlib.asp" language="jscript" runat="server"/>

(never tried that either...)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 28

Expert Comment

by:sybe
ID: 8026417
no, that sounds weird, it's a client tag, won't work.
0
 
LVL 1

Author Comment

by:djschaap
ID: 8026433
Nice thought, but:

using <%  %> tags:
Active Server Pages, ASP 0116 (0x80004005)
The Script block lacks the close of script tag (%>).
/.../start.inc, line 1

using SCRIPT tags:
Active Server Pages, ASP 0117 (0x80004005)
The Script block lacks the close of script tag (</SCRIPT>) or close of tag symbol (>).
/.../start.inc, line 1


Thanks for trying!
0
 
LVL 28

Accepted Solution

by:
sybe earned 400 total points
ID: 8026434
hmm, after all it's not so bad.

I tried this:

<script runat="server" language="vbscript" src="lib/formfunctions_2.asp"></script>

and removed the <script> tags from the include, and it seems to work...
0
 
LVL 1

Author Comment

by:djschaap
ID: 8026447
(Please ignore my extra comments -- reload does more than I thought!)
0
 
LVL 28

Expert Comment

by:sybe
ID: 8026640
so:....

did it work ?? because i think you got a working answer.
if so, then pls close this question.
0
 
LVL 1

Author Comment

by:djschaap
ID: 8027622
That worked!  Thanks.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

777 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