Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

external.js not executed

Status
Not open for further replies.

cyrus67

Programmer
Nov 16, 2006
4
GB
i have the following code placed in an external javascript file but when it's referenced rather than being executed as i hoped it's being displayed. can anyone please tell me why this is?

the code in index.js:

<!-- Hide script
//<![CDATA[
window.location.href="//]]> End script hiding -->

thanks

Cyrus Tiz
 
Don't think you need all the hiding. If the browser don't support javascripting, I don't think that the external script would be loaded at all.

Try just this

Code:
window.location.href='[URL unfurl="true"]http://www.breakdowncoverandgo.co.uk/index.php';[/URL]

By the way - you can redirect a page w/o javascript. You could go with this meta tag

Code:
<meta 
http-equiv="refresh" content="0;url=http://www.breakdowncoverandgo.co.uk/index.php" />
 
thanks for your help. much appreciated.

in either case the module index.htm works when i try to access it as
but not when i attempt to access
am i correct in my assumption that will access index.htm

i am using firefox 1.5 and index.htm contains

<meta
http-equiv="refresh" content="0;url=http://www.breakdowncoverandgo.co.uk/index.php" />

now, as per ur instruction

thanks

Cyrus
 
About entering


It depends on the server configuration which file would be accessed. The server configuration typically holds a list of default files, and in which order the server will look for them -when no file name is entered.

In either case, I recommand that you have only one file named "index.something". "Something" refering to .htm, .html, php, php3 etc...

Note that on some servers, the default name is "default.something"
 
thanks for your patience and help

i had included index.htm and index.js files in my root folder and the latter was superseding the former.

why should the server default to index.js ? is that also server specific?

thanks again

Cyrus
 
Some web hosting services allow users to define the order of priority for the default pages (default.htm(l)/php/asp/cfm, index.htm(l)/php/asp/cfm), and some define it for every site hosted on their server(s). I've never heard of a server being set up to default to ANY kind of JS file over one of the usual HTML page extensions.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top