Re: assistance needed

by "John" <johnmoz(at)ozemail.com.au>

 Date:  Thu, 14 Aug 2003 07:30:26 +1000
 To:  <hwg-techniques(at)hwg.org>
 Cc:  "The McKane Group" <rwm(at)themckanegroup.com>
 References:  ptd
  todo: View Thread, Original
The body of the html document you have down as the one to be loaded into the
popped up window is:

<.body bgcolor="#ffe7c6">
<.SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
  document.write(window.opener.htmlCode)
  document.close()
//-->
</SCRIPT>
<.div align="center">
<.img src="remember1.jpg"><br /><br /><br />
<.a href='javascript:window.close()'>Close</a> this window</div>
</body>

Now note that "undefined" is the first thing to be rendered - not after your
image. And note that it gets rendered - it actually appears on the page.
[Undefined is of course a well know string returned to so you can go "If
undefined then do this" in programing].

Between your body tags, what is the first thing that your code asks the
browser to write into the document? [Have a look before reading on]

The document.write method, the javascript method that makes stuff appear in
the document on the screen as though you had typed the actual stuff in
yourself, is the first thing between your body tags.

It is doing as you ask it but it went to find what where you had
"window.opener.htmlCode" defined in it's document somewhere and couldn't
find it.

It returns undefined.

The bloke who wrote the code that gets loaded into your RAM and hey presto
is your browser decided, either by conforming to a Javascript standard, or
by thinking what would be the best thing to do when a document.write
function has an undefined variable in it, decided he or she would make the
string"undefined" appear on the screen rather than say pop-up an error
message for the user to click OK for example.

----- Original Message -----
From: "The McKane Group" <rwm(at)themckanegroup.com>
To: "HWG techniques" <hwg-techniques(at)hwg.org>
Sent: Thursday, August 14, 2003 6:26 AM
Subject: assistance needed


> I am not a frequent poster because everyone here seems to know a lot more
> than I, but here goes.
>
> I want to have a link on a page that will open a popup on a "sized and
> placed" window.  I have accomplished this but in the pop up window the
> word - UNDEFINED - appears in the upper left hand corner.  I cannot figure
> out how to get rid of it or what I did wrong.
>
> The link is:
> http://www.themckanegroup.com/index1.html
>
> Any assistance would be appreciated.
>
> Bob McKane
> MESSAGES ARE SCANNED BY UPDATED SOFTWARE PRIOR TO SENDING
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA