Re: javascript location

by "Peter-Paul Koch" <gassinaumasis(at)hotmail.com>

 Date:  Wed, 12 Jul 2000 20:09:12 GMT
 To:  marf2000(at)home.com,
hwg-techniques(at)hwg.org
  todo: View Thread, Original
>You could write the URL into a table... The URL should wrap within a table
>entry. Try something like this:
>
><script>
>    document.write('<table width="90%"><tr><td>' + window.location +
>'</td></tr></table>')
></script>

Won't work. The long string (without spaces!) will overrule the width=90%.

Maybe you should use the good old <WBR> tag, which means: "If you want, you 
may break off this string here." Place it after each slash and let the 
browser decide where to break off the string.

Try:

var x = window.location
var y =new Array();
y = x.split('/');
var len = y.length - 1;
var z = '';
for (i=0;i<len;i++)
{
  z = z + y[i] + "/<WBR>";
}
z = z + y[len];
document.write(z);

ppk
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

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