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

J

Jedi Fans

Loony said:
HELP!

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!

Please help!
this script tag is in the head of the document right? just to be clear
in your original code you didnt put </head> but im not sure if that was
a mistake in posting or not
 
L

Loony

this script tag is in the head of the document right? just to be clear
in your original code you didnt put </head> but im not sure if that was
a mistake in posting or not

It's a mistake in posting. In the file it's ok!
 
R

Robi

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
 
L

Loony

Solved!

The path to the file was OK! and the </tags> were put right in the
file.
The problem was an order of function declarations in javascript file.
I have made a new javascript file with new order of declarations using
the order of not defined functions shown by JavaScript console.
Now everything works right! Thanks for help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,281
Latest member
Pedroaciny

Latest Threads

Top