T
Trevor Lawrence
I have a button with an <a> tag which works on the web, but not locally
It is:
<a href="../" target="_parent"> <img style="border: none;"
src="res/up.gif"
onmouseover="this.src=up1.src" onmouseout="this.src=up0.src" width="31"
height="31" title="Up one level" id="up" alt="" /></a>
The code is generated by JAlbum - see
http://trevorl.mvps.org/ratec/AEC buses/album/index.html
When the button up1.src is clicked, it redirects to index.html on the next
level up, i.e. http://trevorl.mvps.org/ratec/AEC buses/index.html - as it
should.
But this same code DOES NOT work on my local disk copy. (By doesn't work, I
mean nothing happens at all)
Why is it so?
Isn't the reference the same whether on the web or local, i.e to index.html
on the next level up?
On the web, mousing over the button shows
http://trevorl.mvps.org/ratec/AEC buses/ in the status bar
On local disk, it shows:
file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/mvpweb/ratec/AEC%20Buses/
Aren't these both a reference to the same file, i.e.
"ratec/AEC%20Buses/index.html" (which exists both locally and on the web)?
(I note some differences in capitalisation of "Buses" but I have checked in
FrontPage and the capitalisation of the folder name exists on the website,
although some internal references may still be lower case. Anyway, the code
in http://trevorl.mvps.org/ratec/Memorabilia/ does the same and there is no
possibility of a capitalisation problem here - it is and was always
capitalised)
Could the function keypress() somehow be working differently when on the web
and not on the web ?
CODE EXTRACT
<head>
<!-- saved from url=(0013)about:internet -->
<title>AEC Buses</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="Keywords" content="photo,album,gallery,AEC Buses" />
<script type="text/javascript">
/* <![CDATA[ */
function keypress(e) {
if(!e) var e = window.event;
if(e.keyCode) keyCode = e.keyCode;
else if(e.which) keyCode = e.which;
switch(keyCode) {
case 8: window.location="../"; return false; break;
case 63273: case 36: window.location="index.html"; return false; break;
case 63275: case 35: window.location="index.html"; return false; break;
case 13: window.location="slides/01 AEC Regal 1927
interior.html?show_param=3"; break;
}
return true;
}
function keypresslistener() {
if(document.all) document.onkeydown = keypress;
else if(document.layers || document.getElementById) document.onkeypress =
keypress;
}
up0 = new Image(31,31); up0.src = "res/up.gif";
up1 = new Image(31,31); up1.src = "res/up1.gif";
next0 = new Image(31,31);next0.src = "res/next.gif";
next1 = new Image(31,31);next1.src = "res/next1.gif";
prev0 = new Image(31,31);prev0.src = "res/prev.gif";
prev1 = new Image(31,31);prev1.src = "res/prev1.gif";
/* ]]> */
</script>
<link rel="stylesheet" type="text/css" href="res/styles.css" />
<style type="text/css">
body { background-image: url(res/bg.gif); background-repeat: repeat-x; }
</style>
</head>
<body id="body" onload="keypresslistener();">
<div style="width:99%; margin-left:auto; margin-right:auto;
text-align:center;">
<table style="height:54px;" align="center" cellspacing="0" cellpadding="0"
border="0">
<tr><td>
<!-- Header of index pages -->
<table style="width:722px;" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="width:31px;">
<a href="../" target="_parent">
<img style="border: none;" src="res/up.gif"
onmouseover="this.src=up1.src" onmouseout="this.src=up0.src" width="31"
height="31" title="Up one level" id="up" alt="" /></a></td>
END OF CODE EXTRACT
It is:
<a href="../" target="_parent"> <img style="border: none;"
src="res/up.gif"
onmouseover="this.src=up1.src" onmouseout="this.src=up0.src" width="31"
height="31" title="Up one level" id="up" alt="" /></a>
The code is generated by JAlbum - see
http://trevorl.mvps.org/ratec/AEC buses/album/index.html
When the button up1.src is clicked, it redirects to index.html on the next
level up, i.e. http://trevorl.mvps.org/ratec/AEC buses/index.html - as it
should.
But this same code DOES NOT work on my local disk copy. (By doesn't work, I
mean nothing happens at all)
Why is it so?
Isn't the reference the same whether on the web or local, i.e to index.html
on the next level up?
On the web, mousing over the button shows
http://trevorl.mvps.org/ratec/AEC buses/ in the status bar
On local disk, it shows:
file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/mvpweb/ratec/AEC%20Buses/
Aren't these both a reference to the same file, i.e.
"ratec/AEC%20Buses/index.html" (which exists both locally and on the web)?
(I note some differences in capitalisation of "Buses" but I have checked in
FrontPage and the capitalisation of the folder name exists on the website,
although some internal references may still be lower case. Anyway, the code
in http://trevorl.mvps.org/ratec/Memorabilia/ does the same and there is no
possibility of a capitalisation problem here - it is and was always
capitalised)
Could the function keypress() somehow be working differently when on the web
and not on the web ?
CODE EXTRACT
<head>
<!-- saved from url=(0013)about:internet -->
<title>AEC Buses</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="Keywords" content="photo,album,gallery,AEC Buses" />
<script type="text/javascript">
/* <![CDATA[ */
function keypress(e) {
if(!e) var e = window.event;
if(e.keyCode) keyCode = e.keyCode;
else if(e.which) keyCode = e.which;
switch(keyCode) {
case 8: window.location="../"; return false; break;
case 63273: case 36: window.location="index.html"; return false; break;
case 63275: case 35: window.location="index.html"; return false; break;
case 13: window.location="slides/01 AEC Regal 1927
interior.html?show_param=3"; break;
}
return true;
}
function keypresslistener() {
if(document.all) document.onkeydown = keypress;
else if(document.layers || document.getElementById) document.onkeypress =
keypress;
}
up0 = new Image(31,31); up0.src = "res/up.gif";
up1 = new Image(31,31); up1.src = "res/up1.gif";
next0 = new Image(31,31);next0.src = "res/next.gif";
next1 = new Image(31,31);next1.src = "res/next1.gif";
prev0 = new Image(31,31);prev0.src = "res/prev.gif";
prev1 = new Image(31,31);prev1.src = "res/prev1.gif";
/* ]]> */
</script>
<link rel="stylesheet" type="text/css" href="res/styles.css" />
<style type="text/css">
body { background-image: url(res/bg.gif); background-repeat: repeat-x; }
</style>
</head>
<body id="body" onload="keypresslistener();">
<div style="width:99%; margin-left:auto; margin-right:auto;
text-align:center;">
<table style="height:54px;" align="center" cellspacing="0" cellpadding="0"
border="0">
<tr><td>
<!-- Header of index pages -->
<table style="width:722px;" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="width:31px;">
<a href="../" target="_parent">
<img style="border: none;" src="res/up.gif"
onmouseover="this.src=up1.src" onmouseout="this.src=up0.src" width="31"
height="31" title="Up one level" id="up" alt="" /></a></td>
END OF CODE EXTRACT