|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
<a href ...> not workingIt 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%20buses/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%20buses/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%20buses/ 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 No it is not the same locally, unless you are running IIS.
-- Show quote============================================== Thomas A. Rowe Microsoft MVP - FrontPage http://www.Ecom-Data.com ============================================== "Trevor Lawrence" <Trevor L.@Canberra> wrote in message news:OSqH72yIIHA.4592@TK2MSFTNGP02.phx.gbl... >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%20buses/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%20buses/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%20buses/ 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 > -- > Trevor Lawrence > Canberra > Microsoft MVP - FrontPage > MVP Web Site http://trevorl.mvps.org > > > > > "Thomas A. Rowe" <tar***@mvps.org> wrote in message Then what is needed locally?news:eTzbeyzIIHA.2064@TK2MSFTNGP06.phx.gbl... > No it is not the same locally, unless you are running IIS. If you go to the site, you can check that it works there, but absolutely nothing happens on local disk. I am trying to copy this site to work on a non-internet connected PC, so if I could get an answer, it would be great. > Then what is needed locally? You'd need the full local address of the page. C:\xxxx\whatever.htm.> > If you go to the site, you can check that it works there, but absolutely > nothing happens on local disk. > > I am trying to copy this site to work on a non-internet connected PC, so > if I could get an answer, it would be great. > -- Or you could use JavaScript, which should work locally, onclick="history.back();" although this is often not recommended for a number of reasons I can't recall(!). Ian,
Thanks for responding. It would be great to figure this out as it is a niggling problem. "Ian Haynes" <ihay***@data-insite.co.uk> wrote in message I have tried that.I changed the code to:news:F4CE54CB-23D3-4BF5-B7DE-F1524E7B5A44@microsoft.com... > >> Then what is needed locally? >> >> If you go to the site, you can check that it works there, but absolutely >> nothing happens on local disk. >> >> I am trying to copy this site to work on a non-internet connected PC, so >> if I could get an answer, it would be great. >> -- > > You'd need the full local address of the page. C:\xxxx\whatever.htm. <!--a href="../" target="_parent"--> <a href= "C:\Documents and Settings\Administrator\My Documents\My Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"> When hovered over, the status bar reads: file:///C:/Documents%20and Settings/Administrator/My%20Documents/My%20Webs/mvpweb/ratec/AEC%20Buses/index.html This code (the original) <a href="../" target="_parent"> <!-- a href= "C:\Documents and Settings\Administrator\My Documents\My Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"--> causes this to be displayed in the status bar: file:///C:/Documents%20and Settings/Administrator/My%20Documents/My%20Webs/mvpweb/ratec/AEC%20Buses/ In neither case does clicking the button do anything. If the full name had have worked I was going to write JS to test the current location and if the website name wasn't present (or even just the characters "http://") then I would use the local name. Else I would use <a href= "../ " > Or you could use JavaScript, which should work locally, One reason I can't do that is that the last page may not be the one I want. > onclick="history.back();" although this is often not recommended for a > number of reasons I can't recall(!). JAlbum will open a separate page for each picture so if 10 have been viewed, one would need to go back 10 times to get to the higher level index.html page On 11/12/2007 7:40 PM, Trevor Lawrence wrote:
Show quote > Ian, Make sure you've replaced all spaces with %20, and take out the > Thanks for responding. It would be great to figure this out as it is a > niggling problem. > > "Ian Haynes" <ihay***@data-insite.co.uk> wrote in message > news:F4CE54CB-23D3-4BF5-B7DE-F1524E7B5A44@microsoft.com... >>> Then what is needed locally? >>> >>> If you go to the site, you can check that it works there, but absolutely >>> nothing happens on local disk. >>> >>> I am trying to copy this site to work on a non-internet connected PC, so >>> if I could get an answer, it would be great. >>> -- >> You'd need the full local address of the page. C:\xxxx\whatever.htm. > > I have tried that.I changed the code to: > <!--a href="../" target="_parent"--> > <a href= "C:\Documents and Settings\Administrator\My Documents\My > Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"> > When hovered over, the status bar reads: > file:///C:/Documents%20and > Settings/Administrator/My%20Documents/My%20Webs/mvpweb/ratec/AEC%20Buses/index.html > > This code (the original) > <a href="../" target="_parent"> > <!-- a href= "C:\Documents and Settings\Administrator\My Documents\My > Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"--> > causes this to be displayed in the status bar: > file:///C:/Documents%20and > Settings/Administrator/My%20Documents/My%20Webs/mvpweb/ratec/AEC%20Buses/ > > In neither case does clicking the button do anything. If the full name had > have worked I was going to write JS to test the current location and if the > website name wasn't present (or even just the characters "http://") then I > would use the local name. Else I would use <a href= "../ " > >> Or you could use JavaScript, which should work locally, >> onclick="history.back();" although this is often not recommended for a >> number of reasons I can't recall(!). > > One reason I can't do that is that the last page may not be the one I want. > JAlbum will open a separate page for each picture so if 10 have been viewed, > one would need to go back 10 times to get to the higher level index.html > page commenting marks (<!-- -->. This: <!-- a href= "C:\Documents and Settings\Administrator\My Documents\My > Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"--> should be<a href= "C:\Documents%20and%20Settings\Administrator\My%20Documents\My%20Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"> -- Paul S. Wolf, PE, FITE mailto:paul.s.w***@alum.wpi.edu
Show quote
"Paul S Wolf" <paul.s.w***@alum.wpi.edu> wrote in message Strange.news:uTeajEZJIHA.2480@TK2MSFTNGP05.phx.gbl... > Make sure you've replaced all spaces with %20, and take out the commenting > marks (<!-- -->. This: > > <!-- a href= "C:\Documents and Settings\Administrator\My Documents\My > > Webs\mvpweb\ratec\AEC Buses\index.html" target="_parent"--> > > should be > > <a href= > "C:\Documents%20and%20Settings\Administrator\My%20Documents\My%20Webs\mvpweb\ratec\AEC > Buses\index.html" target="_parent"> I have this code <a href= "C:\Documents%20and%20Settings\Administrator\My%20Documents\My%20Webs\mvpweb\ratec\AEC%20Buses\index.html" 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> Hovering over the button (up.gif) gives this in the status bar file:///C:/Documents%2520andSettings/Administrator/My%2520Documents/My%2520Webs/mvpweb/ratec/AEC%2520Buses/index.html Clicking it, of course, does nothing > Strange. The %2520's are there because the url is not fully url encoded.> I have this code > <a href= > "C:\Documents%20and%20Settings\Administrator\My%20Documents\My%20Webs\mvpweb\ratec\AEC%20Buses\index.html" > 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> > > Hovering over the button (up.gif) gives this in the status bar > file:///C:/Documents%2520andSettings/Administrator/My%2520Documents/My%2520Webs/mvpweb/ratec/AEC%2520Buses/index.html > For an easy way to do this see: http://www.hypergurl.com/urlencode.html file:///c%3A%5CDocuments%20and%20Settings%5CAdministrator%5CMy%20Documents%5CMy%20Webs%5Cmvpweb%5Cratec%5CAEC%20Buses%5Cindex.html Note the non-encoded file:/// as well. This keeps the link absolute. When trying this out with some local links I found that c:\ worked and C:\ did'nt. Not sure why. You need to run it locally as a server-based site, not as a disk-based site.
-- Show quote============================================== Thomas A. Rowe Microsoft MVP - FrontPage http://www.Ecom-Data.com ============================================== "Trevor Lawrence" <Trevor L.@Canberra> wrote in message news:OG4$k71IIHA.3672@TK2MSFTNGP02.phx.gbl... > > "Thomas A. Rowe" <tar***@mvps.org> wrote in message news:eTzbeyzIIHA.2064@TK2MSFTNGP06.phx.gbl... >> No it is not the same locally, unless you are running IIS. > > Then what is needed locally? > > If you go to the site, you can check that it works there, but absolutely nothing happens on local > disk. > > I am trying to copy this site to work on a non-internet connected PC, so if I could get an answer, > it would be great. > -- > Trevor Lawrence > Canberra > Microsoft MVP - FrontPage > MVP Web Site http://trevorl.mvps.org > |
|||||||||||||||||||||||