-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.html
More file actions
47 lines (42 loc) · 1.33 KB
/
list.html
File metadata and controls
47 lines (42 loc) · 1.33 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ReadThatShit</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var form = $("#save_form");
var formSent = function(response) {
$("#save_result_message").html("¡<strong>" + response.title + "</strong> guardado!");
};
var sendFormByAjax = function(form) {
var url = form.attr("action");
var data = form.serialize();
$.ajax({
url: url,
data: data,
type: "post",
dataType: "json"
}).success(formSent);
};
form.submit(function(event) {
event.preventDefault();
sendFormByAjax($(this));
});
});
$(document).ready(function(){
var hash = window.location.hash;
var machine_friendly_name = hash.replace("#", "");
$("#machine_friendly_name").val(machine_friendly_name);
});
</script>
</head>
<body>
<form method="post" action="save.php" id="save_form">
<input type="hidden" name="machine_friendly_name" id="machine_friendly_name" />
<label for="title">Título:</label><input type="text" id="title" name="title" /> <label for="url">URL:</label><input type="text" id="url" name="url" /> <input type="submit" value="Guardar" />
</form>
<div id="save_result_message"></div>
</body>
</html>