In article < >,
enlightened us with...
> The code below works to a certain extent. There are two things I need
> to get rid of though. One, this code keeps the calling window open
> (i.e., when you click on the URL, a new IE window opens--which is
> fine--but I can't seem to get the code right to close it. This is the
> Javascript I have so far:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Um, we're up to 4.01 these days, and with no URL, it uses quirks mode. That's
bad. However, it's also very much OT in this group.
>
> <html>
> <head>
>
> <script language = "javascript">
The language attribute is deprecated. Use type.
<script type="text/javascript">
> </head>
>
> <body bgcolor="#000080">
>
> <p align="center"><font size="5" color="#800000"><b><span
> style="background-color: #FFFFFF">Opening
> Database</span></b></font>
> </p>
This is an old page, isn't it?
CSS is your friend. *g*
>
> </body>
>
> <script language = "javascript">
>
> {
>
> window.navigate("file:///C:/avail.bat");
window.navigate?
Is this for IE only? I hope so...because that's all it will work in!! *heh*
> parent.window.close;
um, what's that for?
To close the IE window?
But you can't do that without confirmation. It isn't nice to close people's
windows and javascript is made to be used for the internet. It doesn't know
you're using it for an intranet app. Unless you use an HTA. See below.
>
>
>
> If you follow the URL that calls this Javascript, you get a file open
> confirmation message, which I would like to override (this URL is only
> on an intranet, so it's only going to people I know) or simply stop.
>
> How can I:
>
> 1. Close the IE window that calls this Javascript once the Access
> database is open (i.e., the batch has run)?
>
> 2. Override the confirmation message that pops up?
>
IMO...You're going about this ALL wrong.
You want to have something that your users (who all have windows and MSIE)
can use to open an Access file, then it closes itself with no confirmation?
You want an HTA.
Have a looky-see here. This just opens Excel and closes the HTA window (NOT
the IE window that opened the HTA, just so we're clear).
It can be opened from IE with a url or file->open or it can just be double-
clicked or file->open from windows explorer or whatever.
test.hta:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Run Executable HTA</TITLE>
</HEAD>
<body bgcolor=#565656>
<script language="javascript" type="text/javascript">
var oShell = new ActiveXObject("WScript.Shell");
var prog = "C:\\Program Files\\Microsoft Office\\Office\\Excel.exe";
oShell.run ('"'+prog+'"',1);
window.close();
</script>
</BODY>
</HTML>
--
--
~kaeli~
User: The word computer professionals use when they mean
'idiot'.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace