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:
[email protected]...
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? ^ said:
<SCRIPT>
<!--
other javascript scripts working propely
//-->
</SCRIPT>
--> said:
<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:
[email protected]:
Matt Kruse wrote in message news:
[email protected]:
<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:
[email protected]...
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