473,386 Members | 1,819 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,386 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 3997
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.