By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

status or error of opened window

P: n/a
If I open a window like this

mywin=window.open("http://localhost:3456/" );

Is there a way to find out, in the calling javascript code, if the
opened window mywin could read server information from
"http://localhost:3456/".

I tried mywin.error and mywin.status, but it's not yet clear to me what
to do.

In mywin, the (Dutch) InternetExplorer version, it can, sometimes say,
could not open this page. (To be exact: In Dutch "De pagina kan niet
worden weergegeven".)

My goal is actually to find out, if there is something running on
localhost that is listening on port 3456. There might be other ways to
do this then checking mywin even..???

Jan 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
marc wrote:
If I open a window like this

mywin=window.open("http://localhost:3456/" );

Is there a way to find out, in the calling javascript code, if the
opened window mywin could read server information from
"http://localhost:3456/".

I tried mywin.error and mywin.status, but it's not yet clear to me what
to do.
Window objects have no built-in `error' property. They have a `status'
property that specifies the string value in the window's status bar.
In mywin, the (Dutch) InternetExplorer version, it can, sometimes say,
could not open this page. (To be exact: In Dutch "De pagina kan niet
worden weergegeven".)


You could evaluate properties of mywin.document and their properties to
test for certain content, such as

var o;
if (mywin && !mywin.closed
&& (o = mywin.document)
&& (o = mywin.document.body)
&& (o.innerHTML.indexOf("kan niet worden weergegeven") > 0)
{
// handle problem with localhost:3456
}

(RTSL.)

But that would apply for local application and a restricted set of browsers
and configurations only; for example, Firefox before version 1.5 did not
display a local error document but an error message box; in IE, the level
of verbosity of local error documents is user-defined.
PointedEars
Jan 11 '06 #2

P: n/a
marc wrote:
If I open a window like this

mywin=window.open("http://localhost:3456/" );

Is there a way to find out, in the calling javascript code, if the
opened window mywin could read server information from
"http://localhost:3456/".

I tried mywin.error and mywin.status, but it's not yet clear to me what
to do.
Window objects have no built-in `error' property. They have a `status'
property that specifies the string value in the window's status bar.
In mywin, the (Dutch) InternetExplorer version, it can, sometimes say,
could not open this page. (To be exact: In Dutch "De pagina kan niet
worden weergegeven".)


You could evaluate properties of mywin.document and their properties to
test for certain content, such as

var o;
if (mywin && !mywin.closed
&& (o = mywin.document)
&& (o = mywin.document.body)
&& o.innerHTML.indexOf("kan niet worden weergegeven") > 0)
{
// handle problem with localhost:3456
}

(RTSL.)

But that would apply for local application and a restricted set of browsers
and configurations only; for example, Firefox before version 1.5 did not
display a local error document but an error message box; in IE, the level
of verbosity of local error documents is user-defined.
PointedEars
Jan 11 '06 #3

P: n/a
Thomas:
var o;
if (mywin && !mywin.closed
&& (o = mywin.document)
&& (o = mywin.document.body)
&& o.innerHTML.indexOf("kan niet worden weergegeven") > 0)
{
// handle problem with localhost:3456
}


I think this probably could not work because the opened window is not
synchronized with the opener window. Hence this javascript code won't
wait for the opened window to find the url, there is no control when

o.innerHTML.indexOf("kan niet worden weergegeven")

is called. Probably it is called when an other system thread is opening
a new browser Window O.S. browser-window, before the 2nd browser tries
to reach the url.
I tried the code, it does not seem to work.

So it seems I have to solve my problem differently, not with changes in
my javascript.

Jan 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.