npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

najaxjs

v1.1.0

Published

Ajax simple library. You can use ajax easily and customize request & response behaviors.

Downloads

12

Readme

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.

| Reference | Tutorial | Description | Default ver | Tiny ver | Micro ver | RLK ver | |:---|:---|:---|:---|:---|:---| | $najax | tutorial-static-najax.html | $najax various methods tutorials. | Yes | Part | - | - | | $najax@ex | tutorial-najax-ex.html | $najax.send / $najax.sendex tutorials. | Yes | - | - | - | | $najax@helper | tutorial-najax-helper.html | $najax helper methods. | Yes | Yes | - | - | | $najax@read | tutorial-najax-read.html | $najax.require / $najax.load / $najax.module tutorials. | Yes | Yes | - | - | | $najax@class | tutorial-najax-class.html | Singular / Pager / Reflector class tutorials. | Yes | - | - | - | | $najax.history | tutorial-static-history.html | $najax.history tutorials. | Yes | - | - | - | | Micro version | tutorial-static-najax-micro.html | Micro version. | - | - | Yes | - | | Relay / Linker | tutorial-relaylinker.html tutorial-rlk-standalone.html | Relay and Linker class tutorials. | Yes | Yes | - | Yes | | --- | tutorial-demo-ui-ajax.html | Ajax and UI demo. Used various methods. | - | - | - | - |

Distributions

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

Ajax response type

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 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)

| Library | Introduction | Requirements | |:---|:---|:---| | anyjs | Basic methods and UI helper library. | jQuery library | | najaxjs | Simple ajax library. | None | | nviewjs | View template engine. | jQuery library / anyjs |

License

Released under the MIT license. See LICENSE.

ChangeLog

See CHANGELOG.