Forum Moderators: open

Message Too Old, No Replies

HTA and HTML

         

gaucho

8:19 pm on May 15, 2005 (gmt 0)

10+ Year Member



hI,

Please, reading carefully the following two codes:

MYBROWSER.HTM

<html>
<head>
<script>
function doIt()
{
frames['ifr'].location.href=document.f1.link.value;
}
</script>
</head>
<body>
<iframe name=ifr></iframe>
<form name=f1>
<input type=text name=link value="http://js-x.com/">
<a href='javascript:doIt()'>Click Me</a>
</form>
</body>
</html>

MYBROWSER.HTA

<HTML>
<HEAD>
<TITLE>MyBrowser</TITLE>
<HTA:APPLICATION
ID = "oApp"
APPLICATIONNAME = "Drive coll and obj"
BORDER = "thin"
CAPTION = "yes"
ICON = "app.ico"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE = "maximize"
SCROLL = "yes"
SCROLLFLAT = "yes"
VERSION = "1.0"
INNERBORDER = "yes"
SELECTION = "yes"
MAXIMIZEBUTTON = "yes"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "yes"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal"
>

<SCRIPT LANGUAGE="VBScript">
Option Explicit

Sub btnGo_onclick
Dim strAddr

strAddr = txtAddress.value

If InStr(1, strAddr, "://") = 0 Then
strAddr = "http://" & strAddr
End If

frmClient.document.location.href = strAddr
End Sub

Sub btnBack_onclick
frmClient.history.back
End Sub

Sub btnFwd_onclick
frmClient.history.forward
End Sub
</SCRIPT>
</HEAD>
<BODY scroll="no">
Address:
<INPUT TYPE="Text" ID="txtAddress">&nbsp;
<INPUT TYPE="Submit" ID="btnGo" VALUE="Go">
<BUTTON ID="btnBack" STYLE="position:relative;left:50px">
&lt; Back</BUTTON>&nbsp;
<BUTTON ID="btnFwd" STYLE="position:relative;left:50px">
Forward &gt;</BUTTON>
<P>
<IFRAME ID="frmClient"
TRUSTED="yes"
SRC="http://www.microsoft.com"
WIDTH="100%"
HEIGHT="90%"
>
</IFRAME>
</BODY>
</HTML>

What are I want with two files?

1. The MYBROWSER.HTM file mus be call MYBROWSER.HTA file.
THE FILENAME ORIGINATED BY FUNCTION:

<script>
function doIt()
{
frames['ifr'].location.href=document.f1.link.value;
}
</script>

must be opened in the <iframe> of mybrowser.hta (frmClient).

Automatically and always the mybrowser.htm must open Mybrowser.hta

Many Thankx

G.

ZachFSW

8:24 am on May 16, 2005 (gmt 0)

10+ Year Member



If I am reading you correctly - you want to go to .htm file to auto open .hta file?

Why not just link directly to the .hta file?

If you have different names and such - just grab the location.href and break it down however you want

Though honestly I have no clue what you are asking - here is what I do know though.

1) you are not going to auto open an HTA from a server - ever - its always going to go through the user, and ask them if you want to open it.
2) if you need it to work in anything other than IE - forget it
3) Your forward and back buttons are going to be pretty much useless
4) Dont use an HTA unless you have some very specific reason to need that extra power, that is worth the amount of time you are going to have to spend explaining what is so different about .hta to users.
5) Also recognize that some users will have programs on their computer that will not allow an HTA file to run, even if they have IE, ever.

(I also happen to love HTAs :))