-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathcheckdir.html
More file actions
32 lines (29 loc) · 746 Bytes
/
checkdir.html
File metadata and controls
32 lines (29 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
</head>
<body>
<form action="checkdir.php">
<input type="submit" value="click on me!">
</form>
<div class="the-return">
[HTML is replaced when successful.]
</div>
<script type="text/javascript">
$("document").ready(function(){
var data = {
"action": "test"
};
data = $(this).serialize() + "&" + $.param(data);
$.ajax({
type: "POST",
dataType: "json",
url: "checkdir.php", //Relative or absolute path to response.php file
data: data,
success: function(data) {
$(".the-return").html(data["names"]);
//alert("Form submitted successfully.\nReturned json: " + data["json"]);
}
});
});
</script>
</body>