Minimal Ajax Request for jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>gojax example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="gojax.min.js"></script>
</head>
<body>
<!-- Content -->
</body>
</html>
for none form serialize();
gojax('get', '/api/user/all', {data:'123'})
.done()
.fail();
for form serialize();
gojax_f('post', '/api/user/save', '#form_id')
.done()
.fail();
gojax(type: string, url: string, data: object);
type | url | data |
---|---|---|
required | required | optional |
gojax_f(type: string, url: string, data: string);
type | url | data |
---|---|---|
required | required | required |