Re: status or error of opened window



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
.



Relevant Pages

  • Re: javascript in home page address
    ... but there is something else still closing the window. ... Dutch ... >> I am running WinXP Home and since the SP2 install, ... >> browser window opens and immediately closes again, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: javascript in home page address
    ... but there is something else still closing the window. ... Dutch ... >> I am running WinXP Home and since the SP2 install, ... >> browser window opens and immediately closes again, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: OT FOR OUR ARIZONA PEOPLE
    ... "Mummy was mad and threw Grand-papa out the window." ... Just a guess from the Dutch and Yiddish I know ...
    (rec.pets.cats.anecdotes)
  • Re: OT FOR OUR ARIZONA PEOPLE
    ... "Mummy was mad and threw Grand-papa out the window." ... Just a guess from the Dutch and Yiddish I know ...
    (rec.pets.cats.anecdotes)

Loading