473,394 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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
23 16090
VK
> <SCRIPT LANGUAGE="JavaScript" SRC="../inc/JSfile.js"><SCRIPT*>

The closing tag: </SCRIPT>

Jul 28 '05 #2
My fault I haven't pasted that from file. In the file it's ok!

So try again:) please!

Jul 28 '05 #3


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
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
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
> 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
>Firefox does not allow relative path:
Try fully qualified path

Whar do you mean exactly?

Jul 28 '05 #8
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


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
>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
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
>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
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
No I haven't, my JSfile of javascripts looks like that

function Name_1()
{
}

function Name_2()
{
}
....

Jul 28 '05 #15
>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
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
>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
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
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
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
>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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: David D. | last post by:
Does the file extension matter when including a JavaScript file in an HTML page? Normally, one would include a JavaScript file in an HTML page using <script src="foo.JS" type="text/javascript">...
6
by: rob | last post by:
Hi I'm trying to create a "roll-up" effect when a window loses focus and then "roll-down" when it regains focus. This statement works properly with every browser I can get my hands on EXCEPT...
10
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
4
by: stevong | last post by:
It works on Konquerer though. I remember it works on IE too. I've tried window.close() too. Doesn't work on Firefox also. I've also tried to create a function. It doesnt work on Firefox also....
1
by: tilt | last post by:
Hello, I use an object element to replace the iframe element in ie, like this: <object id="x_obj" data="http://.../" type="text/html"> <iframe name="x_if" id="x_if"...
3
by: joe | last post by:
Is it OK to have multiple: <script type="text/javascript" src="funcs1.js"></script> <script type="text/javascript" src="funcs2.js"></script> <script type="text/javascript"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.