Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>HTA works like a normal windows application.<br> You write HTML code, and save it as an .hta file.<br /><br /> However, there are, at least, one drawback: The browser can't open an .hta file; it's handled as a normal .exe program. So, if you place a link to an .hta onto your web page, it will open a download dialog, asking of you want to open or save the HTA file. If its not a problem for you, you can click "Open" and it will open a new window (that have no toolbars, so no Back button, neither address bar, neither menubar).<br /> <br /> I needed to do something very similar to what you want, but instead of <code>iframes</code>, I used a real <code>frameset</code>.<br> The main page need to be a .hta file; the other should be a normal .htm page (or .php or whatever).<br /><br /> Here's an example of a HTA page with 2 frames, where the top one have a button and a text field, that contains the second frame URL; the button updates the field:</p> <h3>frameset.hta</h3> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;HTA Example&lt;/title&gt; &lt;HTA:APPLICATION id="frames" border="thin" caption="yes" icon="http://www.google.com/favicon.ico" showintaskbar="yes" singleinstance="no" sysmenu="yes" navigable="yes" contextmenu="no" innerborder="no" scroll="auto" scrollflat="yes" selection="yes" windowstate="normal"&gt;&lt;/HTA:APPLICATION&gt; &lt;/head&gt; &lt;frameset rows="60px, *"&gt; &lt;frame src="topo.htm" name="topo" id="topo" application="yes" /&gt; &lt;frame src="http://www.google.com" name="conteudo" id="conteudo" application="yes" /&gt; &lt;/frameset&gt; &lt;/html&gt; </code></pre> <ul> <li>There's an <code>HTA:APPLICATION</code> tag that sets some properties to the file; it's good to have, but it isn't a must.</li> <li>You <em>NEED</em> to place an <code>application="yes"</code> at the frames' tags. It says they belongs to the program too and should have access to all data (if you don't, the frames will still show the error you had before). </li> </ul> <h3>topo.htm</h3> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Topo&lt;/title&gt; &lt;script type="text/javascript"&gt; function copia_url() { campo.value = parent.conteudo.location; } &lt;/script&gt; &lt;/head&gt; &lt;body style="background: lightBlue;" onload="copia_url()"&gt; &lt;input type="button" value="Copiar URL" onclick="copia_url()" /&gt; &lt;input type="text" size="120" id="campo" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <ul> <li>You should notice that I didn't used any getElement function to fetch the field; on HTA file, all elements that have an ID becomes instantly an object</li> </ul> <p>I hope this help you, and others that get to this question. It solved my problem, that looks like to be the same as you have.<br /><br /> You can found more information here: <a href="http://www.irt.org/articles/js191/index.htm" rel="nofollow noreferrer">http://www.irt.org/articles/js191/index.htm</a><br /><br /> Enjoy =]</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload