1.1.0 • Published 10 years ago

najaxjs v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

MIT License

najaxjs - Ajax simple library

any series   https://any-js.github.io/

Features

  • 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.

Requirements

  • None. Any other library is unnecessary. (Only $najax.sendex method requires anyjs and jQuery library.)

Browser Support

  • Modern web-browsers(Chrome, IE, Firefox, Safari, Opera) support.
  • IE browser: Support IE9. Loose support in IE8. (You can use most of the functions.)
  • Legacy browser partially support.

Basic usage(code example)

// 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.

Tutorials / Demos / Reference

There are many tutorials.

ReferenceTutorialDescriptionDefault verTiny verMicro verRLK ver
$najaxtutorial-static-najax.html$najax various methods tutorials.YesPart--
$najax@extutorial-najax-ex.html$najax.send / $najax.sendex tutorials.Yes---
$najax@helpertutorial-najax-helper.html$najax helper methods.YesYes--
$najax@readtutorial-najax-read.html$najax.require / $najax.load / $najax.module tutorials.YesYes--
$najax@classtutorial-najax-class.htmlSingular / Pager / Reflector class tutorials.Yes---
$najax.historytutorial-static-history.html$najax.history tutorials.Yes---
Micro versiontutorial-static-najax-micro.htmlMicro version.--Yes-
Relay / Linkertutorial-relaylinker.html tutorial-rlk-standalone.htmlRelay and Linker class tutorials.YesYes-Yes
---tutorial-demo-ui-ajax.htmlAjax and UI demo. Used various methods.----

Distributions

For detail, see reference. In dist directory,

DistributionIntroduction
najax.js / najax.min.jsDefault version.
najax-tiny.js / najax-tiny.min.jsTiny 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.jsMicro version. Not include helper methods.
rlk.js / rlk.min.jsRelay / Linker standalone version.

Ajax response type

See Nx.type for detail.

TypeDescriptionValue type
json(*)Json.assoc
rawRaw data.string
textText. text is same as raw.string
htmlHTML.Element
scriptExecute script.null
funcFunction.function
jsonpJsonp.null
csvCsv(Tsv).array
xmlXml.XMLDocument
blobBlob.Blob
otherXMLHttpRequest.responseType.Varies.

Nx class specification

Nx class. This class is created automatically by $najax various method.

Specification

  • Specify ajax request and response behaviors by Nx object.
  • Specify by Nx object's various method or Nx opt method.
  • Begin ajax connection by Nx done.
  • Nx done returns Relay object.
  • Relay provide operating response-data, and bundling multiple Relay.
  • Nx implement ajax by using XMLHttpRequest.

Relation library(any-js series)

LibraryIntroductionRequirements
anyjsBasic methods and UI helper library.jQuery library
najaxjsSimple ajax library.None
nviewjsView template engine.jQuery library / anyjs

License

Released under the MIT license. See LICENSE.

ChangeLog

See CHANGELOG.

1.1.0

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.0

10 years ago

1.0.0-beta2

10 years ago