forked from flouthoc/minAjax.js
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
236 lines (195 loc) · 8.03 KB
/
index.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>
minAjax.js - A Minimalistic JavaScript Libary To Perform AJAX POST/GET
</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js">
</script>
<script type="text/javascript" src="index.js">
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
<!-- Custom styles for this template -->
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]>
<script src="../../assets/js/ie8-responsive-file-warning.js">
</script>
<![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js">
</script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js">
</script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js">
</script>
<![endif]-->
<script>
hljs.initHighlightingOnLoad();
</script>
</head>
<style>
#head{
height:30px;
background-color:#3498db;
border-bottom:1px solid #3498db;
}
</style>
<body>
<div id="head" class="col-md-12">
<a href="https://github.com/flouthoc/minAjax.js">
<img style="position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/567c3a48d796e2fc06ea80409cc9dd82bf714434/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png">
</a>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>
minAjax.js
</h1>
<p>
A Pure Javascript minimalistic Library to Perform AJAX POST/GET request.
</p>
<div class="col-md-12">
<table>
<tr>
<td>
<iframe src="http://ghbtns.com/github-btn.html?user=flouthoc&repo=minAjax.js&type=watch&size=large" height="30" width="100" frameborder="0" scrolling="0" style="width:100px; height: 30px;" allowTransparency="true">
</iframe>
</td>
<td>
<iframe src="http://ghbtns.com/github-btn.html?user=flouthoc&repo=minAjax.js&type=fork&size=large" height="30" width="100" frameborder="0" scrolling="0" style="width:100px; height: 30px;" allowTransparency="true">
</iframe>
</td>
<td>
<iframe src="http://ghbtns.com/github-btn.html?user=flouthoc&type=follow&size=large" height="30" width="240" frameborder="0" scrolling="0" style="width:240px; height: 30px;" allowTransparency="true">
</iframe>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-12">
<center>
<a href="https://raw.githubusercontent.com/flouthoc/minAjax.js/master/index.js" class="btn btn-default btn-lg">
Download v1.0
</a>
</center>
</div>
<div class="col-md-12">
<h2>Getting It Into Your Html</h2>
<pre><code class="xml"><script type="text/javascript" src="https://raw.githubusercontent.com/flouthoc/minAjax.js/master/index.js"></script></code></pre>
</div>
<div class="col-md-12">
<h2>Usage:</h2>
<h4>Example</h4>
<pre><code class="javascript">minAjax({
url:"test.php",//request URL
type:"GET",//Request type GET/POST
//Send Data in form of GET/POST
data:{
name:"batman",
profession:"detective",
worth:"Rich",
company:"Wayne Enterprises"
},
//CALLBACK FUNCTION with RESPONSE as argument
success: function(data){
alert(data);
}
});</code></pre>
<p>This is example to use minAjax() , these are the frequent arguments which are usually passed for request to take place there are some optional arguments i'll explain them below.</p>
</div>
<div class="col-md-12"><h1><b>Compulsory Arguments</b></h1></div>
<div class="col-md-6">
<h2><b>url:</b></h2> <span class="label label-primary">Compulsory</span>
<pre><code class="javascript">url:'Path or Link to Server Side.'</code></pre>
<p></p>
</div>
<div class="col-md-6">
<h2><b>type:</b></h2> <span class="label label-primary">Compulsory</span>
<pre><code class="javascript">type:"GET or POST"</code></pre>
<p></p>
</div>
<div class="col-md-12"><h1><b>Optional Arguments</b></h1></div>
<div class="col-md-12">
<h2><b>data:</b></h2> <span class="label label-warning">Optional</span>
<pre><code class="javascript">data:{
param1:value1,
param2:value2,
param3:value3,
param4:value4,
//also send arrays as data
foo2:["bar2","bar 3","bar+4"]
//and blah blah as many param as things support.
}</code></pre>
<p></p>
</div>
<div class="col-md-12">
<h2><b>success:</b></h2> <span class="label label-warning">Optional</span>
<pre><code class="javascript">success: function(data){
alert(data);
//function to be executed on true response with response TEXT as argument.
}</code></pre>
<p>Execution of Callback function on valid response is totally optional , function can take <b>Response text</b> and <b> Response Status</b> as arguments to process on client side.</p>
</div>
<div class="col-md-6">
<h2><b>method:</b></h2> <span class="label label-warning">Optional</span>
<pre><code class="javascript">method:'True For Asyn and False for Non-Async | By default it is True'</code></pre>
<p>By Default Method will be <b>True</b> i.e <b>Async</b> calls . <b>You Can Leave This</b></p>
</div>
<div class="col-md-6">
<h2><b>debugLog:</b></h2> <span class="label label-warning">Optional</span>
<pre><code class="javascript">debugLog:'True to enable Debug Console Logs | By Default it is False'</code></pre>
<p>By Default Method will be <b>False | You Can Leave This</b></p>
</div>
<div class="col-md-12">
<h4>Example with all arguments</h4>
<pre><code class="javascript">minAjax({
url:"test.php",//request URL
type:"GET",//Request type GET/POST
//Send Data in form of GET/POST
data:{
name:"Superman",
secretname:"Clark Kent",
profession:"reporter",
worth:"poor",
company:"Daily Planet"
},
method:"true",
debugLog:"true",
//CALLBACK FUNCTION with RESPONSE as argument
success: function(data){
alert(data);
}
});</code></pre>
</div>
<div class="col-md-12">
<h2>
To-Do's (Not Yet Implemented)
</h2>
<p>
1.) Implentation of all HTTP Request.
</p>
</div>
</div>
<hr>
<footer>
</footer>
</div>
</body>
</html>