473,241 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

ASP editing .js file

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
Jul 19 '05 #1
7 3992
it should be able to. IIS reads it in then closes it. You should be able to
open it, write to it, close it fairly quickly.
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.
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mike D" <an*******@discussions.microsoft.com> wrote in message
news:0e****************************@phx.gbl...
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

Jul 19 '05 #2
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>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
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

-----Original Message-----
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>

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

Jul 19 '05 #4
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?
<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>


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)
Jul 19 '05 #5
-----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?
<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>


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
Jul 19 '05 #6
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 %> ?]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #7
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 %> ?]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: joethis | last post by:
Is there a way to make sure that a file is already in use using asp? For instance, if one person has opened a file and is about to write to it; then is there a way to keep another user from...
4
by: Jerry Khoo | last post by:
i am currently working on an assignment that requires the program to manage the files like editing file content, modifying file content, and deleting file contents. My question is what sort of...
7
by: A_StClaire_ | last post by:
hi, I'm working on a project spanning five .cpp files. each file was used to define a class. the first has my Main and an #include for each of the other files. problem is my third file...
5
by: VB Programmer | last post by:
I want to write to a simple text file. If it doesn't exist I want to create it first. Here is my code (portion): Imports System.IO ' at the top of the class : : Dim strFileName As String =...
0
by: Roshan | last post by:
Hi, I am writing an app which needs to access & edit files on a remote share using the UNC path. I can access and edit the file using a simple StreamReader/Writer as long as the share has full...
12
by: Thomas Bartkus | last post by:
Does anyone use emacs together with both WordStar key bindings and python mode? I'm afraid that Wordstar editing key commands are burned R/O into my knuckles! I would like to play with emacs...
8
by: D | last post by:
Hi, I currently have a Python app with a Tkinter GUI frontend that I use for system administration. Everytime it launches, it reads a text file which contains info about each host I wish to...
0
by: ltfcphil | last post by:
Hi, Bit of a noobie question I'm afraid.... I have a program to open a file,read out part of each record to a text box, make a selection then extract the entire record. This works OK. Now I...
16
by: Lawrence Krubner | last post by:
To guard against our users possibly uploading huge files, I've got this in my php.ini file: ; Maximum size of POST data that PHP will accept. post_max_size = 10M On a server running Ubuntu...
1
by: crazyGal | last post by:
Hi there, I'm working on a task that deals with editing a PCL (Printer Command Language) file. The requirement is search/replace a key/value pair if found in the file. When I try this, either...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.