f



Strange behavior

Why if, f.e., if I write in the page:

var r = (document.referrer).toLowerCase();
var p = r.split("middle")[1];
document.write("-->"+p);

it works

but if I put this script in an external script and insert into multiple 
pages with

<script src="my.js"></script>

it doesn't?

Help appreciated.

Regards.

-- 
Fabri
("Sono pi� di 30 punti...ma � come se fossere 8 o 9....")
0
Fabri
6/9/2005 3:47:39 PM
comp.lang.javascript 38370 articles. 0 followers. javascript4 (1315) is leader. Post Follow

3 Replies
440 Views

Similar Articles

[PageSpeed] 46

	The code is fine, so long there's a document.referrer you can grab off  
the window.history stack, document.referrer returns the previous url in  
the history object provided this page was loaded BY CLICKING ON A LINK ON  
THE PREVIOUS PAGE, if not, it'll return a blank, and window.history can be  
flushed by several things, the server may be restricting the browser to no  
caching, or opening a browser session, or a secure connection with no  
caching or page expirations.


							Danny


On Thu, 09 Jun 2005 08:47:39 -0700, Fabri <no@sp.am> wrote:

> Why if, f.e., if I write in the page:
>
> var r = (document.referrer).toLowerCase();
> var p = r.split("middle")[1];
> document.write("-->"+p);
>
> it works
>
> but if I put this script in an external script and insert into multiple  
> pages with
>
> <script src="my.js"></script>
>
> it doesn't?
>
> Help appreciated.
>
> Regards.
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
0
Danny
6/8/2005 5:05:02 AM
cause of this: --> ( == closing comment tag)

0
VK
6/9/2005 4:04:54 PM
VK wrote:

> cause of this: --> ( == closing comment tag)

There is no such thing as a `comment tag'.  `--' closes an SGML/XML
comment (opened with `--') within an SGML declaration (opened with
`<!') and `>' closes that declaration.


PointedEars
0
Thomas
6/22/2005 5:47:09 PM
Reply: