-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
45 lines (38 loc) · 1.14 KB
/
script.js
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
$(document).ready(function() {
$('#set').click(function(e){
e.preventDefault();
var set_clip = $("#set_clip").val();
$.ajax({
type: "POST",
url: "saveclip.php",
dataType: "json",
data: {data:set_clip},
success : function(data){
if (data.valid == 1){
$("#set_msg").text("Clip Saved successfully. Id to retrive clip is " + data.public_id);
}
else {
$("#set_msg").text("error: " + data.error);
}
}
});
});
$('#get').click(function(e){
e.preventDefault();
var get_id = $("#get_id").val();
$.ajax({
type: "POST",
url: "getclip.php",
dataType: "json",
data: {id:get_id},
success : function(data){
if (data.valid == 1){
$("#get_clip").html(data.clip);
}
else {
$("#get_clip").html("error: " +data.error);
}
}
});
});
});