Freepages-Help-L Archives

Archiver > Freepages-Help > 2002-09 > 1032790902


From: Ken McInnes <>
Subject: [FreeHelp] freepages and JavaScript
Date: Tue, 24 Sep 2002 00:21:42 +1000


G'day,

I disagree with Pat, - sorry Pat :( - as you are creating new
mini-windows 'on-the-fly' with javascript document.write statements
you probably do need:
photoWin.document.write('<html><head><title>' + pTitle +
'</title></head>');

However, I think that rather than just pass 'Photo' across as the
pTitle value, you could use more meaningful titles, perhaps the same
as the caption under each thumbnail.

Within the document.write statements the 'strings' can be broken up
into smaller pieces. For example the word 'body' could be broken up:
photoWin.document.write('<BODY BGCOLOR ...
becomes
photoWin.document.write('<BO'+'DY BGCOLOR ...

photoWin.document.write('<p></font></body></html>');
becomes
photoWin.document.write('<p></font></bo'+'dy></html>');

The + is a concatenation and hence when the content is written to the
new window.document it will be 'joined' and understood by the browser.
This might avoid the parser adding the ads into your javascript code,
or you might need to break the other tags up as well.

I reckon there are probably easier ways to do the same thing in plain
html rather than by creating new windows in javascript, but
nevetheless if it works in all browsers and it produces what you want,
then go for it.

Hope this helps,

regards

Ken McInnes
Ringwood North VIC AUS
--------------------------
Open the gateway to my family history
<http://freepages.genealogy.rootsweb.com/~kenmac/>;
--------------------------


This thread: