Re: <SCRIPT SRC="../..."> doesn't work under Firefox.
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: <SCRIPT SRC="../..."> doesn't work under Firefox.

From: Robi <me@privacy.net>
Date: Mon Aug 01 2005 - 15:24:12 CEST

Ok, I'm going to try here.
with all the "overtrimming" much of the 'discussion' is lost in previous
posts, so forgive me if I pull in text from older posts in this thread.

Loony wrote in message news:1122565913.071369.257280@z14g2000cwz.googlegroups.com...
> I have got a code like this in HTML section in ASP file which includes
> javascript file! The script works under MS IE but doesn't with Firefox!
> Can anybody tell me what is wrong?
>
> <HTML>
> <HEAD><TITLE></TITLE>
> <SCRIPT LANGUAGE="JavaScript" SRC="../inc/JSfile.js"><SCRIPT>
--> ^ type="text/javascript" ^ relative path? ^ </script>
> <SCRIPT>
> <!--
> other javascript scripts working propely
> //-->
> </SCRIPT>
--> </head>
> <BODY>
> ...
> </BODY>
> </HTML>
in the above there are a few things to consider:
1. according to XHTML 'standards' <TAGS> and its attributes should be <lowercase>
2. language is deprecated, type=text/javascript should be used instead
3. close your <tags> with </tags> (</script> and </head>)
4. make sure that relative paths are valid and the file is there.

to 3. you mentioned that it was ok in your original.
now, to continue

Loony wrote in message news:1122625737.920242.66230@g49g2000cwa.googlegroups.com:
> Matt Kruse wrote in message news:dcb5pu0cjr@news1.newsguy.com:
>> Post EXACTLY:
>> 1) The url you see in your browser. Hide the IP if you wish.
>
> http://xxx.xx.xx.xx/e-shop/new_contract.asp
>
>>2) The <script> tag used to access the JS file
> <SCRIPT LANGUAGE ="JavaScript" TYPE="text/javascript" SRC="../inc/validation.js"></SCRIPT>
           ^ language attribute is deprecated
>
> The JS file is located on server xxx.xx.xx.xx\c\Inetpub\inc
> My ASP file is located on server xxx.xx.xx.xx\c\Inetpub\new_contract

ok, so /e-shop is a virtual folder?
IOW, you either access src="../inc/validation.js" as
<ip>/e-shop/inc/validation.js
or
<ip>/inc/validation.js

Loony wrote in message news:1122885313.059940.176890@o13g2000cwo.googlegroups.com...
> My file comes up in the browser when I type
> http://xxx.xx.xx.xx/e-shop/inc /validation.js under MS IE and Firefox.
> The tag <SCRIPT LANGUAGE="JavaScript"
> SRC="../inc/validation.js"></SCRIPT> includes the validation.js file
> under MS IE, but JavaScript console in Firefox still says that
> functions (from validation.js) are not defined.. I have pasted the
> functions from validation.js
> into the ASP file where I have put the tag <SCRIPT
> LANGUAGE="JavaScript" SRC="../inc/validation.js"></SCRIPT> and then
> everything works propely..but I don't want do that this way!
> What should I do..it's really strange!

now from http://xxx.xx.xx.xx/e-shop/new_contract.asp
"../inc/validation.js" resolves to
http://xxx.xx.xx.xx/e-shop/../inc/validation.js
                    ^^^^^^^^^
                    ../ removes e-shop/8
http://xxx.xx.xx.xx/inc/validation.js
so this is where your file should be, but as I understand, it is on
http://xxx.xx.xx.xx/e-shop/inc/validation.js

then the line should read:
<script type="text/javascript" src="inc/validation.js"></script>

without the ../ and no preceding / before inc/validation.js

HTH

Robi
Received on Tue Oct 18 03:04:04 2005