How to read directory using jQuery .ajax()?

Posted by C.W.Holeman II on Stack Overflow See other posts from Stack Overflow or by C.W.Holeman II
Published on 2010-03-25T05:36:28Z Indexed on 2010/03/25 5:43 UTC
Read the original article Hit count: 347

Filed under:
|
|
|

Using jQuery .ajax() to read "./ex.html" returns the expected contents of the file. Using the same call just changing the request to "./" does not return an expected directory listing.

<html>
<head>
</head>
<body>
<script type="text/JavaScript" src="jquery.js"></script>
<script type="text/JavaScript">
    alert($.ajax({type: "GET", url: './ex.html', async: false}).responseText);
    alert($.ajax({type: "GET", url: './', async: false}).responseText);
</script>
</body>
</html>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about .ajax