Why does this code not work locally?

  • Thread starter Trevor Lawrence
  • Start date
T

Trevor Lawrence

This code appears in http://ratec.actbus.net/ZIB674/album/index.html

<TD style="width:31px;">
<a href="../index.html" onmouseover="document.up.src=up1.src"
onmouseout="document.up.src=up0.src" target="_parent">
<img src="res/up.gif" width="31" height="31" border="0" title="Up one level"
name="up" alt=""></a></TD>

The href is, in this case.http://ratec.actbus.net/ZIB674/index.html The
locate to this file works fine when on the web

But on my local copy it does not. The location of the file to locate to
appears in the status bar as
file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/ratec/ZIB674/index.html
but clicking on the link does nothing at all

I thought it may be something to do with "The Mark of the Web" but this
appears at the top
<!-- saved from url=(0013)about:internet -->

Of course, when working locally, I can always find the address I want to go
to, but it is annoying and I can't see why it happens

Can anyone help?
 
T

Trevor Lawrence

OK, I can give that a go.

But I would probably need to do it in JS e.g.
document.getElementById('uplink').href
= (location.href.indexOf('http://')
? '../'
:
'file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/ratec/ZIB674/index.html'

where HTML is
<td style="width:31px;">
<a href="../index.html"

id="uplink"

onmouseover="document.up.src=up1.src"
onmouseout="document.up.src=up0.src" target="_parent">
<img src="res/up.gif" width="31" height="31" border="0" title="Up one
level" name="up" alt=""></a></td>

Got to be elsewhere right now, but if all else fails, I'll try this.
 
T

Trevor Lawrence

I tried various combinations
e.g.
file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/ratec/ZIB674/index.html
C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/ratec/ZIB674/index.html
C:\Documents%20and%20Settings\Administrator\My%20Documents\My%20Webs/ratec\ZIB674/index.html
C:/Documents and Settings/Administrator/My Documents/My
Webs/ratec/ZIB674/index.html
C:\Documents and Settings\Administrator\My Documents\My
Webs/ratec\ZIB674/index.html

All of these showed the same in the status bar, i.e.
file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/ratec/ZIB674/index.html

None of them worked.

Eventually, I tried

<td style="width:31px;">
<a href="../index.html"
onmouseover="document.up.src=up1.src"
onmouseout="document.up.src=up0.src" target="_parent">
<img src="res/up.gif"
onclick="location.href='C:/Documents and Settings/Administrator/My
Documents/My Webs/ratec/ZIB674/index.html'"
width="31" height="31" border="0" title="Up one
level" name="up" alt=""></a></td>

This returned
Line 52
Char 1
Error Permission denied
Code 0
URL
file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/My%20Webs/ratec/ZIB674/album/index.html

Line 52 of this file is
onclick="location.href='C:/Documents and Settings/Administrator/My
Documents/My Webs/ratec/ZIB674/index.html'"

What causes this when I am using my local website? I am logged on as
Administrator (There is no other account.)
 

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

Top