• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ajax Request Component for React.

React-Ajax

Ajax Request Component for React.

Demo & Examples

Live demo: yuanyan.github.io/react-ajax

To build the examples locally, run:

npm install
gulp dev

Then open localhost:9999 in a browser.

Installation

The easiest way to use React-ajax is to install it from NPM and include it in your own React build process (using Browserify, etc).

You can also use the standalone build by including dist/react-ajax.js in your page. If you use this, make sure you have already included React, and it is available as a global variable.

npm install react-ajax --save

Usage

var Ajax = require('react-ajax');

<Ajax url="data.json" onResponse={this.responseHandler} />

Properties

  • url The request url.
  • method The HTTP method to use such as 'GET', 'POST', 'PUT', or 'DELETE'. Default is 'GET'.
  • params Parameters to send to the specified URL.
  • body Optional raw body content to send when method === "POST".
  • headers HTTP request headers to send.
  • accept Setting HTTP accept header, specify either the full canonicalized MIME type name as type/subtype, or the extension suffix form as "xml", "json", "png".
  • type Setting HTTP contentType header, accepting the canonicalized MIME type name complete with type/subtype, or simply the extension name such as "xml", "json", "png".
  • withCredentials Set the withCredentials flag on the request.
  • timeout Request timeouts(ms).

Events

These are the special events implemented by ajax.

  • onResponse fired when request response

More Repositories

1

halogen

A collection of loading spinners with React.js
JavaScript
1,596
star
2

boron

A collection of dialog animations with React.js
JavaScript
1,481
star
3

react-timesheet

Time Sheet Component for React
JavaScript
259
star
4

pragmatic-jquery

Pragmatic jQuery Style
111
star
5

node-optimage

Image optimizer, PNG, JPEG and GIFimage compress on OS X, Linux, FreeBSD and Windows
JavaScript
67
star
6

domkit

Toolkit for DOM
JavaScript
61
star
7

node-regexp

New RegExp Style for Node.js
JavaScript
59
star
8

ming

High-productivity JavaScript Solution
JavaScript
51
star
9

jsprofiler

javascript profiler
JavaScript
45
star
10

UglifyJS-java

JavaScript parser / mangler / compressor / beautifier library for for Java
JavaScript
42
star
11

react-native-web-example

React Native Web Example
JavaScript
40
star
12

react-image

Enhanced Image Component for React.
JavaScript
36
star
13

hp

HTTP Proxy Kit
JavaScript
33
star
14

react-mq

Media Query Component for React.
JavaScript
26
star
15

react-storage

Storage Component for React
JavaScript
25
star
16

know-your-chrome

know your chrome
C++
21
star
17

pre

An enjoyable css framework use less
JavaScript
19
star
18

node-webp-bin

WebP Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows.
JavaScript
16
star
19

commons-json

A high performance JSON library for java
Java
13
star
20

barium

Pragmatic Styling with React.js
JavaScript
13
star
21

haste-resolver-webpack-plugin

Haste Resolver Webpack Plugin
JavaScript
12
star
22

react-signals

Signals Component for React.
JavaScript
11
star
23

react-pull

Pull Component for React
JavaScript
8
star
24

arsenic

Backgroud component for React
JavaScript
8
star
25

react-native-web-exploding-hearts

React Native Web Exploding Hearts Example
JavaScript
8
star
26

mobi

Framework for developing mobile only projects on the web.
JavaScript
7
star
27

google-cli

Google CLI.
JavaScript
7
star
28

requirejs-tmpl

Require.js plugin for templates, it's a tooling not a library
JavaScript
7
star
29

fanta

when function met fanta.
JavaScript
7
star
30

ship

Code manager client
JavaScript
5
star
31

morse

Morse Code Game (WIP)
JavaScript
4
star
32

universal-react-starter

A professional universal (isomorphic) react starter for building web apps.
JavaScript
4
star
33

less2

LESS 2.0
JavaScript
4
star
34

yuanyan.github.io

Website
JavaScript
4
star
35

ladybug

Making The Mobile Web Faster
JavaScript
3
star
36

jquery-sonar

jQuery sonar effect plugin
JavaScript
3
star
37

moon

js&css file server on top of nodejs
JavaScript
3
star
38

404

QQ Connect 404 Page
3
star
39

haste-resolver

Haste Resolver
JavaScript
3
star
40

jazz

jazz is js
JavaScript
3
star
41

react-native-web-hacker-news

Objective-C
3
star
42

react-native-generator

JavaScript
3
star
43

ninjs

Javascript Ninja's Garden
JavaScript
3
star
44

node-isabspath

Predicate method for testing whether a path is absolute
JavaScript
3
star
45

Ning

Node.js Web Application Driver (WIP)
JavaScript
3
star
46

commons-algorithm

commons.algorithm
Java
2
star
47

jquery-jsonview

json data visualization for jquery
JavaScript
2
star
48

sublime-mod

Mod for Sublime Text
Python
2
star
49

soundbox.js

JavaScript library for audio processing(WIP)
JavaScript
2
star
50

tencent-hackathon-scoring

Tencent Hackathon Scoring Application
JavaScript
2
star
51

fitnect

Tencent Hackthon Work
JavaScript
2
star
52

stylesheet-loader

JavaScript
2
star
53

select

A micro css selector engine
JavaScript
1
star
54

mircotask

High performance task scheduler
JavaScript
1
star
55

webpack-html-plugin

JavaScript
1
star
56

node-unixifypath

Unixify pathname for Node.js
JavaScript
1
star
57

resume

My Resumรฉ is open
CSS
1
star
58

square-ui

Square User Interface Kit For Mobile Web (Work In Process)
CSS
1
star
59

jquery-storage

cross browser storage module for jquery
JavaScript
1
star