najaxjs. Ajax simple library. You can use ajax easily and customize request & response behaviors.
Supported response-type is raw text / json / jsonp / html / script / csv / or others...
And it has many ajax options, async / sync / retry / timeout / cache / or others
by Nx object
.
Cross-domain requests supported by $najax.scriptTag / $najax.jsonpTag
.
There are various helper methods, $najax.url
, $najax.query
, $najax.submit.
And $najax@helper, Singular, Pager, Reflector classes
support 'ajax + ui'.
$najax.history
can easily operate url-history(push / replace / listen).
Relay
/ Linker
class. It can bundle responses.
// Ajax by $najax.request
$najax.request(url).done();
//
// Set request and response behaviors by Nx
$najax.request(url).type('text').timeout(5).retry(3).done();
$najax.csv(url).done();
$najax.sync(url).param('stone', 'age').done();
//
// It's possible to set success / fail / complete function
$najax.request(url).success(sccs).complete(cmp).done();
$najax.request(url).fail(fail).complete(cmp).done();
$najax.request(url).done(sccs);
//
//
// Others
// See tutorials.
For detail, see reference. In dist directory,
Distribution | Introduction |
---|---|
najax.js / najax.min.js | Default version. |
najax-tiny.js / najax-tiny.min.js | Tiny version. Not include the below.$najax.history $najax.send / $najax.sendex $najax.scriptTag / $najax.jsonpTag $najax@class(Singular, Pager, Reflector)
|
najax-micro.js / najax-micro.min.js | Micro version. Not include helper methods. |
rlk.js / rlk.min.js | Relay / Linker standalone version. |
See [Nx.type] for detail.
Type | Description | Value type |
---|---|---|
json(*) |
Json. | assoc |
raw |
Raw data. | string |
text |
Text. text is same as raw. | string |
html |
HTML. | Element |
script |
Execute script. | null |
func |
Function. | function |
jsonp |
Jsonp. | null |
csv |
Csv(Tsv). | array |
xml |
Xml. | XMLDocument |
blob |
Blob. | Blob |
other |
XMLHttpRequest.responseType. | Varies. |
Nx class. This class is created automatically by $najax various method.
Specification
Nx object
.Nx opt
method.Nx done
.Nx done
returns Relay object
.Relay
provide operating response-data, and bundling multiple Relay
.Nx
implement ajax by using XMLHttpRequest.Library | Introduction | Requirements |
---|---|---|
anyjs | Basic methods and UI helper library. | jQuery library |
najaxjs | Simple ajax library. | None |
nviewjs | View template engine. | jQuery library / anyjs |
Released under the MIT license. See LICENSE.
See CHANGELOG.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。