In the first two paragraphs a click produces an alert box with the content of the specified file. In the second two there is no alert box.
<html><head>
<script type="text/javascript" src="../../../../resources/jquery_1-4-2.js"></script>
</head><body>
<p onclick="$.get('/home/user/0/1/2/3/4/4a.html','',function(a){alert(a);});">
Get /home/user/0/1/2/3/4/4a.html</p>
<p onclick="$.get('/home/user/0/1/2/3/4/resources/4ra.html','',function(a){alert(a);});">
Get /home/user/0/1/2/3/4/resources/4ra.html</p>
<p onclick="$.get('/home/user/0/0a.html','',function(a){alert(a);});">
Get /home/user/0/0a.html</p>
<p onclick="$.get('/home/user/0/1/2/3/resources/3ra.html','',function(a){alert(a);});">
Get /home/user/0/1/2/3/resources/3ra.html</p>
</body></html>
System and browser:
Linux Road 2.6.32-23-generic-pae #37-Ubuntu SMP Fri Jun 11 09:26:55 UTC 2010 i686 GNU/Linux
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100628 Ubuntu/10.04 (lucid) Firefox/3.6.6
The files are on the local file system. The url used is:
file:///home/user/0/1/2/3/4/test.html
The contents of each of the four files display as expected when the urls are entered into the web browser address bar by copying the urls directly from the displayed page (/home/user/0/1/2/3/4/4a.html
, /home/user/0/1/2/3/4/resources/4ra.html
, /home/user/0/0a.html
, /home/user/0/1/2/3/resources/3ra.html
).
But, accessing the file with http://localhost:8000/home/user/0/1/2/3/4/test.html, using:
python -m SimpleHTTPServer
then all four work as expected.