This includes the path. You'll have to cut it away if you don't want it.
/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
what is the difference between this two method?
sorry, i m new user, maybe ask a stupid question...
thx
"Grant Wagner" <gwagner@agrico reunited.com> ???
news:3F4E05CA.7 F80C5AA@agricor eunited.com ???...[color=blue]
> "§Þ¦w" wrote:
>[color=green]
> > How can i get the present filename (the opened html) and print it in the
> > html (this html)?
> > thx[/color]
>
> var protocol = window.location .protocol;
> var path = window.location .pathname;
> // this is required because IE loading files locally uses "\" and not "/"
> var separator = (protocol == "file:" && path.indexOf("/", 1) == -1 ? "\\"[/color]
:[color=blue]
> "/");
> var path = window.location .pathname;
> var file = path.substring( path.lastIndexO f(separator) + 1);
> document.write( file);
>
>
>
> --
> | Grant Wagner <gwagner@agrico reunited.com>
>
> * Client-side Javascript and Netscape 4 DOM Reference available at:
> *
>[/color] http://devedge.netscape.com/library/...ce/frames.html[color=blue]
>
> * Internet Explorer DOM Reference available at:
> *
>[/color] http://msdn.microsoft.com/workshop/a...ence_entry.asp[color=blue]
>
> * Netscape 6/7 DOM Reference available at:
> * http://www.mozilla.org/docs/dom/domref/
> * Tips for upgrading JavaScript for Netscape 7 / Mozilla
> * http://www.mozilla.org/docs/web-deve...upgrade_2.html
>
>[/color]
Between what two method? The code I provided in a single solution that provides the
functionality you originally required (to output the filename of the current file loaded
into the browser).
?? wrote:
[color=blue]
> what is the difference between this two method?
> sorry, i m new user, maybe ask a stupid question...
> thx
>
> "Grant Wagner" <gwagner@agrico reunited.com> ???
> news:3F4E05CA.7 F80C5AA@agricor eunited.com ???...[color=green]
> > "§Þ¦w" wrote:
> >[color=darkred]
> > > How can i get the present filename (the opened html) and print it in the
> > > html (this html)?
> > > thx[/color]
> >
> > var protocol = window.location .protocol;
> > var path = window.location .pathname;
> > // this is required because IE loading files locally uses "\" and not "/"
> > var separator = (protocol == "file:" && path.indexOf("/", 1) == -1 ? "\\"[/color]
> :[color=green]
> > "/");
> > var path = window.location .pathname;
> > var file = path.substring( path.lastIndexO f(separator) + 1);
> > document.write( file);[/color][/color]
Comment