ASP editing .js file

M

Mike D

I have a .js menu file that runs in all of my intranet
files. I have an asp calendar system where I can add
calendar names to a db and it will display these new
calendars. What I don't have is a good way to edit my .js
menu file to add a new menu item.

Can fso add a line to a .js file that is "live" on an
intranet or will it run into file locks? by iis??

I am writing the code to try it now but I thought I would
ask.

Thanks
Mike
 
E

Evertjan.

Curt_C [MVP] wrote on 05 aug 2004 in
microsoft.public.inetserver.asp.general:
Just be careful though. Many browsers will cache the .JS file I
believe so even after a change you may not see the changes on the
clients/browsers right away.

If you have trouble with the .js caching, why not just insert the file ASP-
wize:

<script style="text/javascript">
<!--#include virtual ="/lib/myJs.js"-->
</script>

You can even specigy the expiry in the js file by specifying it as
<% Response.Expires = 1 %> so:

<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>
 
M

Mike D

Thanks for the reply I have not used virtual includes
before. I there an advantage to putting all of my
includes in a virtual folder? Or do you maintain your
includes in the web?

Mike
 
E

Evertjan.

Mike D wrote on 06 aug 2004 in microsoft.public.inetserver.asp.general:
Thanks for the reply I have not used virtual includes
before. I there an advantage to putting all of my
includes in a virtual folder? Or do you maintain your
includes in the web?

Are these contradictory?

This is not a virtual folder,
just a virtual specification of a very real folder,
"relative" to the web root. A virtual path!

The advantage over a relative include is, that you can change the
"includer's" path/location while path to the included file remains valid.

[please do not toppost when replying on usenet]
 
M

Mike D

-----Original Message-----
Mike D wrote on 06 aug 2004 in microsoft.public.inetserver.asp.general:
Thanks for the reply I have not used virtual includes
before. I there an advantage to putting all of my
includes in a virtual folder? Or do you maintain your
includes in the web?

Are these contradictory?

This is not a virtual folder,
just a virtual specification of a very real folder,
"relative" to the web root. A virtual path!

The advantage over a relative include is, that you can change the
"includer's" path/location while path to the included file remains valid.

[please do not toppost when replying on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.

If I have a path Myweb/Includes I can add an include file
using

<script type="text/javascript" language="JavaScript"
src="Includes/MenuLib.js"></script>

but I can't use the virtual syntax (these are copied from
different levels)

<!--#include virtual ="/../../Includes/MenuLib.js"-->

If I add a new Virtual Directory and point it to the
includes pathe it still can't find the file but if I make
a new folder outside of the web structure and point to
that with a virtual directory the page can be found.??

Make sense?

Mike
 
E

Evertjan.

Mike D wrote on 06 aug 2004 in microsoft.public.inetserver.asp.general:
<!--#include virtual ="/../../Includes/MenuLib.js"-->

If I add a new Virtual Directory and point it to the
includes pathe it still can't find the file but if I make
a new folder outside of the web structure and point to
that with a virtual directory the page can be found.??

No. Include virtual must be a descendant of the root, so in the web
structure, I think.

Perhaps this will do:

<% Server.execute Server.mappath("/../../lib/myJs.asp") %>

[The whole idea was to have a .asp file
so that you can head that with a <% Response.Expires = 0 %> ?]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top