All Projects → JayZangwill → lightings

JayZangwill / lightings

Licence: MIT license
A lightweight Ajax Library

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to lightings

Uploader
A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Stars: ✭ 1,042 (+5110%)
Mutual labels:  lightweight, ajax
electron-request
Zero-dependency, Lightweight HTTP request client for Electron or Node.js
Stars: ✭ 45 (+125%)
Mutual labels:  lightweight, ajax
Questions
Web app inspired by Quora, allowing users ask question and get answers
Stars: ✭ 15 (-25%)
Mutual labels:  ajax
ajax
Ajax wrapper for nim js backend
Stars: ✭ 18 (-10%)
Mutual labels:  ajax
larashop55
Shopping cart website in Laravel 5.5 with Ajax
Stars: ✭ 51 (+155%)
Mutual labels:  ajax
ConfigAssets
Simple & Lightweight solution for managing configuration assets in Unity projects
Stars: ✭ 26 (+30%)
Mutual labels:  lightweight
zEditor
a lightweight rich text editor | 一款超轻量级富文本编辑器 | 1行核心JS代码实现功能
Stars: ✭ 76 (+280%)
Mutual labels:  lightweight
Last-Launcher
Lightweight: Faster than light, Low on memory
Stars: ✭ 148 (+640%)
Mutual labels:  lightweight
MobilePose
Light-weight Single Person Pose Estimator
Stars: ✭ 588 (+2840%)
Mutual labels:  lightweight
typesafe-i18n
A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects.
Stars: ✭ 1,227 (+6035%)
Mutual labels:  lightweight
AMS
Attendance management system made my me, which I use for taking attendance.
Stars: ✭ 13 (-35%)
Mutual labels:  ajax
koochak
A minimal & lightweight CSS framework
Stars: ✭ 15 (-25%)
Mutual labels:  lightweight
sms
🏫 🎓 一个未使用框架的学生信息管理系统 : 项目概述全面,代码注释详细,逻辑结构清晰,非常适合作为初学 Java web 的同学的第一个练手项目啦 ~
Stars: ✭ 91 (+355%)
Mutual labels:  ajax
DovakinMQ
MQTT broker for java based on Netty
Stars: ✭ 14 (-30%)
Mutual labels:  lightweight
memory signature
A small wrapper class providing an unified interface to search for various memory signatures
Stars: ✭ 69 (+245%)
Mutual labels:  lightweight
Willow
The Web Interaction Library that eases the burden of creating AJAX-based web applications
Stars: ✭ 41 (+105%)
Mutual labels:  ajax
quicli
Create CLI's quickly without any external files!
Stars: ✭ 24 (+20%)
Mutual labels:  lightweight
nova-select-plus
A Laravel Nova Select Field
Stars: ✭ 67 (+235%)
Mutual labels:  ajax
group-transformer
Official code for Group-Transformer (Scale down Transformer by Grouping Features for a Lightweight Character-level Language Model, COLING-2020).
Stars: ✭ 21 (+5%)
Mutual labels:  lightweight
nmu
neg4n's mathematics utilities
Stars: ✭ 17 (-15%)
Mutual labels:  lightweight

Lightings

中文文档 | English

A lightweight Ajax framework based on ES6 Promise, support for template rendering.

Installing

npm install lightings

Directory structure:

lightings
	|---src
	|    |---lightings.js (es6 source)
	|    |---promise.js (low browser support Promise)
	|
	|---dist
     	     |---lightings.js (use bable compiler source code es5)
	     |---lightings.min.js

tip:If your browser supports ES6 syntax can be directly used in the src directory of the ES6 source code.

Example

tip:Examples of uniform use of JSON data:

{
	"name": "Lightings",
	"author": {
		"firstName": "Jay",
		"lastName": "Zangwill"
	}
}

Performing a GET request(using template rendering)

lightings.get('test.json',{
	config: true,
	el: '#app'
}).then(function(data){
		console.log(data);
		//other operation
}).catch(function(error){
	console.log(error);
});
<!-- html -->
<div id="app">
	<p>author: {{author.firstName}} {{author.lastName}}</p>
	<p>name: {{name}}</p>
</div>

Performing a GET request(do not use template rendering)

lightings.get('test.json')
	.then(function(data){
		console.log(data);
		//dom operation and other operation
	}).catch(function(error){
		console.log(error);
	});

Cross domain request

lightings.jsonp('http://jayzangwill.cn/test.json')
	.then(function(data){
		console.log(data);
		//dom operation and other operation
	}).catch(function(error){
		console.log(error);
	});

lightings API

lightings.get(url[,data,[options]])

lightings.post(url[,data,[options]])

lightings.jsonp(url[,data,[options]])

NOTE

  1. When using options as the second argument, you need to pass a config:true property, such as
lightings.get('test.json',{
	config:true,
	...
});
  1. jsonp does not support template rendering, timeout, progress

parameter options(configurable item)

  1. el:lightings mount elements for template rendering.(Only in the data format for JSON support get, post)
  2. dataType:server data return format,default is JSON, optional value: JSON,XML, HTML, text.
  3. async: whether asynchronous.default asynchronous.
  4. contentType: request header.(only support post requests)
  5. timeout: timeout. default 0 (no timeout is set)
  6. progress:a function in the process of sending a request to the Ajax

Update log

2017 3.15 v1.1.0

  1. Add timeout configuration item. (jsonp does not support timeout)
  2. Add progress configuration item. (jsonp does not support timeout)

2017 3.27 v1.2.0

Fixed low browser Promise function

2017 4.5 v1.3.0

  1. Fixed a bug in IE9 under bug
  2. Support template rendering(jsonp does not support)

2017 4.7 v2.0.0

modify lightings API, abolish some outdated configuration

2017 4.7 v2.0.1

optimized template rendering

2017 4.13 v2.0.2

  1. Fixed issue where async could not be set to false
  2. Fixed issue with false unable to get data when set to Async

2018 4.06 V2.0.3

  1. Fixe some bug
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].