-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathload_html.html
70 lines (67 loc) · 2.37 KB
/
load_html.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css" >
</head>
<body>
<div class="container">
<div class="row">
<h1>Load remove content with AJAX</h1>
<p>When button is clicked, it loads HTML content from specified url and puts it to specified target element</p>
<textarea class="code" style="width: 99%; height: 360px" readonly>
<button type="button"
data-as='{
"click": {
"load": {
"url": "./data/partial_content.php",
"block": true,
"blockOptions": {
"message": "<h2>Custom loading message</h2>"
},
"success": {
"html": {
"target": "#div"
}
}
}
}
}'
>Load content</button>
<div id="div"></div>
</textarea>
</div>
<div class="row mt-30">
<div class="col-md-6">
<button type="button"
data-as='{
"click": {
"load": {
"url": "./data/partial_content.php?sleep=1000",
"block": true,
"blockOptions": {
"message": "<h2>Custom loading message</h2>"
},
"success": {
"html": {
"target": "#target"
}
}
}
}
}'
>Load content</button>
</div>
<div id="target" class="col-md-6">
it will be loaded here...
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="http://malsup.github.io/jquery.blockUI.js"></script>
<script src="../build/Release/as.js"></script>
</body>
</html>