By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,874 Members | 1,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,874 IT Pros & Developers. It's quick & easy.

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

P: n/a
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>
<SCRIPT>
<!--
other javascript scripts working propely
//-->
</SCRIPT>
<BODY>
....
</BODY>
</HTML>

Jul 28 '05 #1
Share this Question
Share on Google+
23 Replies


P: n/a
VK
> <SCRIPT LANGUAGE="JavaScript" SRC="../inc/JSfile.js"><SCRIPT*>

The closing tag: </SCRIPT>

Jul 28 '05 #2

P: n/a
My fault I haven't pasted that from file. In the file it's ok!

So try again:) please!

Jul 28 '05 #3

P: n/a


Loony wrote:
My fault I haven't pasted that from file. In the file it's ok!


Post a URL where the problem occurs.
Why do you think that the file is not loaded, do you get script errors,
which ones exactly?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 28 '05 #4

P: n/a
VK


Loony wrote:
My fault I haven't pasted that from file. In the file it's ok!

So try again:) please!


Just killed my Firefox again during a rude vivisection.

Possibilities:

1) Firefox does not allow relative path:
Try fully qualified path

2) You open the page from local drive so src doesn't point to the right
place.

3) Somehow the <base> tag got set in the header section.

Actually if the (1) doesn't help, then (2) and (3) are for sport only.
The real reason then in the script code itself. IE forgives much more
mistakes than FF and executes it, FF spit it out. What does JavaScript
console says?

Jul 28 '05 #5

P: n/a
On Thursday 28 July 2005 16:51, Loony(lo*****@op.pl) wrote in message
<11**********************@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>


Shouldn't it be this instead?

<script type="text/javascript" src="../inc/JSfile.js"></script>
Jul 28 '05 #6

P: n/a
> Why do you think that the file is not loaded, do you get script errors,
which ones exactly?

I get errros in JavaScript that for example function XXX() is not
defined!
If I paste the script into the file then it's ok, but if it's outside
the file, imprted from the url it doesn't work, so it's not the script
code itself.
You open the page from local drive so src doesn't point to the right place.

No I don't I don't all files are placed on the local network server!
So the src must point to the right place!
Somehow the <base> tag got set in the header section.

What do you mean?

Jul 28 '05 #7

P: n/a
>Firefox does not allow relative path:
Try fully qualified path

Whar do you mean exactly?

Jul 28 '05 #8

P: n/a
In article <11*********************@o13g2000cwo.googlegroups. com>,
sc**********@yahoo.com says...


Loony wrote:
My fault I haven't pasted that from file. In the file it's ok!

So try again:) please!


Just killed my Firefox again during a rude vivisection.

Possibilities:

1) Firefox does not allow relative path:
Try fully qualified path


You can rule that one out right now.

--
Hywel

Kill the Crazy Frog
http://www.petitiononline.com/crzyfrg/
Jul 28 '05 #9

P: n/a


Loony wrote:

I get errros in JavaScript that for example function XXX() is not
defined!
If I paste the script into the file then it's ok, but if it's outside
the file, imprted from the url it doesn't work, so it's not the script
code itself.


Post a URL where the problem occurs.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 28 '05 #10

P: n/a
>Post a URL where the problem occurs.

I can't post the url, because it is not public ip.
The structure of the network is:
Server at ip:xxx.xxx.xx.xx on drive c so i can get to the source code!
My ASP file is in yyy/aaa folder and the JSfile.js is in the yyy/bbb
folder
so to point the file I type <script src="../bbb/Jsfile.js"></script>

On local drive it works, it dosent work on the server!

Jul 28 '05 #11

P: n/a
Loony wrote:
Post a URL where the problem occurs.

I can't post the url, because it is not public ip.


Post EXACTLY:
1) The url you see in your browser. Hide the IP if you wish.

2) The <script> tag used to access the JS file

From that, we can compute the URL to the JS file. Putting that in manually
should bring the JS file from the server. I suspect the file is not where
you think it is. That's usually the case in situations like this.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 28 '05 #12

P: n/a
>Post EXACTLY:
1) The url you see in your browser. Hide the IP if you wish.
2) The <script> tag used to access the JS file

OK I will do it tomorrow!
Sorry for my language, English isn't my native language.

Jul 28 '05 #13

P: n/a
Loony wrote:
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?


Have you put SGML (HTML) comments in your Javascript? If so - Don't.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 28 '05 #14

P: n/a
No I haven't, my JSfile of javascripts looks like that

function Name_1()
{
}

function Name_2()
{
}
....

Jul 28 '05 #15

P: n/a
>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>

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

Jul 29 '05 #16

P: n/a
Loony wrote:
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>


Then your js file should be at:
http://xxx.xx.xx.xx/inc/validation.js

Type that into your browser and see if it comes up.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 29 '05 #17

P: n/a
>Then your js file should be at:
http://xxx.xx.xx.xx/inc/valida tion.js Type that into your browser and see if it comes up.


My files comes up at http://xxx.xx.xx.xx/e-shop/inc/valida tion.js

So what path to the file should I type in my ASP file in tag <SCRIPT
SRC="...">

Aug 1 '05 #18

P: n/a
Loony said the following on 8/1/2005 3:16 AM:
Then your js file should be at:
http://xxx.xx.xx.xx/inc/valida tion.js


Type that into your browser and see if it comes up.

My files comes up at http://xxx.xx.xx.xx/e-shop/inc/valida tion.js

So what path to the file should I type in my ASP file in tag <SCRIPT
SRC="...">


http://xxx.xx.xx.xx/e-shop/inc/validation.js
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 1 '05 #19

P: n/a
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!

Aug 1 '05 #20

P: n/a
Loony wrote:
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
Aug 1 '05 #21

P: n/a
>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!

Aug 1 '05 #22

P: n/a
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:11**********************@z14g2000cwz.googlegr oups.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:11*********************@g49g2000cwa.googlegro ups.com: Matt Kruse wrote in message news:dc********@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:11**********************@o13g2000cwo.googlegr oups.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
Aug 1 '05 #23

P: n/a
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!

Aug 1 '05 #24

This discussion thread is closed

Replies have been disabled for this discussion.