opening a new window from a HTA

A

Andrew Poulos

There's a HTA application that's running on a local computer (not from a
URL) and the user can open a new HTML window by clicking a button

The first time the user clicks the button the window opens. Any
subsequent click causes this dialog, with this error, to appear:

"Error: The remote server machine does not exist or is unavailable"

The relevant code is

oline.onclick = function() {
if (outline.win && outline.win.open && !outline.win.closed) {
outline.win.focus();
} else {
outline.win = window.open(outline.fileName,"", "");
}
};

The MS script debugger claims the error is on the line that starts
"if (outline.win..."

Why does the error occur and how do I resolve it?

Andrew Poulos
 
A

Andrew Poulos

Randy said:
Andrew Poulos said the following on 11/14/2007 5:57 PM:

My first guess would be that it can't get a proper handle on outline
after it has been opened. Does it happen whether the HTML window is open
or closed or only if it is opened?

The first time you click, the HTML window opens as expected.

If I leave the HTML window open and click the button in the HTA nothing
happens. That is, the HTML window stays behind the HTA though the HTML
window's task bar item flashs.

If I close the HTML window, the next time I click the button in the HTA
I get the error.

If I convert the HTA to a HTML page it runs the HTML window opens
without error in IE, Firefox, and Opera.

I tried wrapping the calls in try catch but it works for one case but
not others. At the moment I'm seeing if always closing the HTML window
in a try catch statement will make a positive difference.
Aside from that, can you post a URL to a sample .hta file?

Hmm, maybe but I'll have to created a pared down version so my manager
does come done on me.

Andrew Poulos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top