Newbie: External *js file woes!

C

Craven Birds

I'm trying to get a javascript to work using an external file. Can't seem to
get it to run! Any ideas?

When embedded in the html document it works correctly! I've tried all the
different combinations, I've found on the internet to point to the external
file, with no luck.

Such as:

<SCRIPT language="JavaScript" SRC="myfile.js"></SCRIPT>

<SCRIPT SRC="myfile.js"></SCRIPT>

Also the javascript file HAS the tags remove <SCRIPT> & </SCRIPT>

Help! Any ideas? The javascript in question is a floating menu script, if
that's any help.

TIA

Regards,
Chris
 
C

Craven Birds

jmm-list-gn said:
Is myfile.js in the same current directory as the html file?
Yes

Is the above in the <head> section?

No in the body where it needs to be. Also tried it in the head as well.
No, but a test URL would have been.

Oh! As I said, a newbie.

It seems there is something in the script that's preventing using an
external file. And I haven't a clue:-(((

Regards,
Chris
 
D

Danny@Kendal

Craven Birds said:
I'm trying to get a javascript to work using an external file. Can't seem to
get it to run! Any ideas?

When embedded in the html document it works correctly! I've tried all the
different combinations, I've found on the internet to point to the external
file, with no luck.

If the script isn't in the same folder as the original html file then you
will need to amend all URLs in the script.

Also, change the SCRIPT and SRC to lowercase.
 
C

Craven Birds

Danny@Kendal said:
seem

If the script isn't in the same folder as the original html file then you
will need to amend all URLs in the script.

Also, change the SCRIPT and SRC to lowercase.


Script IS in same folder as HTML file etc, also I used lowercase. The
examples were copied from Tutorial websites.

I'm tearing my hair out here:-( I can't see why it ain't working.

Regards,
Chris
 
R

rf

Craven Birds
I'm tearing my hair out here:-( I can't see why it ain't working.

You will continue to do so untill you provide a URLs to a page that works
and a page that does not work

I for one have my crystal ball in for service.
 
C

Craven Birds

rf said:
Craven Birds


You will continue to do so untill you provide a URLs to a page that works
and a page that does not work

I for one have my crystal ball in for service.

Will this do? Try the link in my signature. I want to use an external
javascript file to run it.

HTH

Regards,
Chris
 
R

rf

Craven said:
Will this do? Try the link in my signature. I want to use an external
javascript file to run it.

And where is your attempt that does *not* work?

Oh my. I'm sorry. I don't know why I sometimes drift into here and post
stuff. I usually don't get out of the HTML/CSS groups, and the alt ones at
that.

I can see that I have again made an error in coming here. I expected to find
some HTML/CSS mixed in with the javascript. You know, like an actual usable
web page. I forgot what really happens in here.

With apoligies, I won't trouble you here again.

Bye.
 
C

Craven Birds

rf said:
And where is your attempt that does *not* work?


Oh my. I'm sorry. I don't know why I sometimes drift into here and post
stuff. I usually don't get out of the HTML/CSS groups, and the alt ones at
that.

I can see that I have again made an error in coming here. I expected to find
some HTML/CSS mixed in with the javascript. You know, like an actual usable
web page. I forgot what really happens in here.

With apoligies, I won't trouble you here again.


Bye ;-0

Cracked it anyway!


Regards,
Chris
 

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,777
Messages
2,569,604
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top