-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
147 lines (147 loc) · 6.96 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EasyAJAX - Simple AJAX requisitions</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="img/favicon.ico" rel="icon" type="image/x-icon"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="EasyAJAX/EasyAJAX.js"></script>
<script src="js/app.js"></script>
<link rel="stylesheet" href="css/app.css">
<link href="https://bonavigo.github.io/EasyAJAX/" rel="canonical"/>
<meta name="theme-color" content="#1F1AA2">
<meta name="keywords" content="ajax, ajax without jquery, post, get, simple ajax">
<meta content="@BrunoBonavigo" name="twitter:site"/>
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@BrunoBonavigo">
<meta name="twitter:creator" content="@BrunoBonavigo">
<meta property="og:site_name" content="EasyAJAX - Simple AJAX requisitions">
<meta property="og:locale" content="pt_BR"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="EasyAJAX - Simple AJAX requisitions"/>
<meta property="og:description" content="A simple library for making AJAX requisitions without jQuery."/>
<meta property="og:url" content="https://bonavigo.github.io/EasyAJAX/"/>
<meta property="og:image" content="https://bonavigo.github.io/EasyAJAX/img/logo.png"/>
<script src="https://kit.fontawesome.com/5db384e8a3.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body class="grey lighten-4">
<header>
<nav class="blue darken-4">
<div class="nav-wrapper container">
<a href="#" class="brand-logo">EasyAJAX</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/~https://github.com/Bonavigo/EasyAJAX">Repository</a></li>
<li><a href="/~https://github.com/Bonavigo">Creator</a></li>
</ul>
</div>
</nav>
</header>
<main>
<div class="container">
<div>
<h4>EasyAJAX</h4>
<h5>A simple library for making AJAX requisitions.</h5>
</div>
<div>
<h5>For example, you can test it here by searching for a Habbo's information here using the Habbo API.</h5>
</div>
</div>
<div class="container" style="margin-top:20px;">
<div class="card-panel">
<div class="row">
<div class="input-field">
<input type="text" id="input_search" onkeypress="verify_enter(event, this.value);">
<label for="input_search">Habbo name</label>
</div>
<div class="input-field">
<select id="hotel">
<option value=".com">International</option>
<option value=".com.br">Brazil</option>
<option value=".com.tr">Turkey</option>
<option value=".de">Germany</option>
<option value=".es">Spain</option>
<option value=".fi">Finland</option>
<option value=".it">Italy</option>
<option value=".nl">Netherlands</option>
</select>
<label>Choose Habbo</label>
</div>
<div class="right">
<button style="background: #2e4757;color:#FFF;" type="button" onclick="search();" class="btn waves-effect waves-light">Search Habbo</button>
</div>
</div>
<div class="row" style="display:none;" id="result">
<div style="width:50px;height:91px;float:left;">
<img src="" id="image_result">
</div>
<div style="float:left;margin-top:10px;margin-left:10px;">
<p>
<strong>Nickname:</strong> <span id="nickname_result"></span><br>
<strong>Motto:</strong> <span id="motto_result"></span><br>
<strong>Creation data:</strong> <span id="creation_result"></span>
</p>
</div>
</div>
<div class="row" style="display:none;" id="error">
<h5>Sorry, the nick you searched doesn't exist.</h5>
</div>
<div class="row" style="display:none;" id="loading">
<h5>Searching in the Habbo API...</h5>
</div>
</div>
</div>
<div class="container" style="margin-top:20px;">
<div class="card-panel">
<h5 id="getting-started"><a href="#getting-started" class="black-text"><b># </b>Getting Started</a></h5>
<p>You can <a href="https://raw.githubusercontent.com/Bonavigo/EasyAJAX/main/EasyAJAX/EasyAJAX.js">download here</a> the normal version and <a href="https://raw.githubusercontent.com/Bonavigo/EasyAJAX/main/EasyAJAX/EasyAJAX.min.js">download here</a> the minified version.</p>
<br>
<h5 id="get"><a href="#get" class="black-text"><b># </b>GET Method</a></h5>
<p>
For using the GET method, you need to use the EasyAJAX object (easyAJAX) and the GET method, resulting in something like this:<br>
<pre class="monospace">easyAJAX.GET(url, success, error);</pre>
url: The URL from the page you want to call;<br>
success: The anonymous function that will be called if the response is 200 (when called, the function will recieve the response);<br>
error: The anonymous function that will be called if the response is equal to 403 or 404;<br>
For example, the GET that is used in this page works like this:<br>
<span class="monospace">
var success = function change_data(response) {<br>
}<br>
var error = function error() {<br>
}
</span>
</p>
<br>
<h5 id="post"><a href="#post" class="black-text"><b># </b>POST Method</a></h5>
<p>
For using the POST method, you need to use the EasyAJAX object (easyAJAX) and the POST method, resulting in something like this:<br>
<pre class="monospace">easyAJAX.POST(url, post, success, error);</pre>
url: The URL from the page you want to call;<br>
post: The POST data you want to send (in x-www-form-urlencoded);<br>
success: The anonymous function that will be called if the response is 200 (when called, the function will recieve the response);<br>
error: The anonymous function that will be called if the response is equal to 403 or 404;
</p>
</div>
</div>
</main>
<footer class="page-footer blue darken-3">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">EasyAJAX</h5>
<p class="grey-text text-lighten-4">Created in 2021 by <b><a class="grey-text text-lighten-4" href="/~https://github.com/Bonavigo">Bruno Bonavigo</a></b>.</p>
<p class="grey-text text-lighten-4">This website isn't affiliated to Sulake Oy. The use of the Habbo API is just for example.</p>
</div>
</div>
</div>
<div class="footer-copyright blue darken-4">
<div class="container">
© <span id="year"></span> Bruno Bonavigo
<a class="grey-text text-lighten-4 right" href="https://twitter.com/BrunoBonavigo">My Twitter</a>
</div>
</div>
</footer>
</body>
</html>