• Stars
    star
    154
  • Rank 242,095 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated about 3 years ago

Reviews

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

Repository Details

A minimalist Javascript library to perform AJAX POST and GET Request.

minAjax.js

A minimalist Javascript library to perform AJAX POST and GET Request.

Check Pretty Documentation

http://flouthoc.github.io/minAjax.js/

Usage

Getting Started

npm i minajax.js
<script type="text/javascript" src="https://cdn.rawgit.com/flouthoc/minAjax.js/master/minify/index.min.js"></script>

Regular

  minAjax({
    url:"test.php",//request URL
    type:"GET",//Request type GET/POST
    //Send Data in form of GET/POST
    data:{
      name:"batman",
      profession:"detective",
      worth:"Rich",
      company:"Wayne Enterprises"
    },
    //CALLBACK FUNCTION with RESPONSE as argument
    success: function(data){
      alert(data);
    }

  });
  

This is example to use minAjax() , these are the frequent arguments which are usually passed for request to take place there are some optional arguments i'll explain them below.

Compulsory Arguments

url:
  url:'Path or Link to Server Side.'
type:
  type:'GET or POST'

Optional Arguments

data:
  data:{
          param1:value1,
          param2:value2,
          param3:value3,
          param4:value4,
          //also send Arrays
          foo2:["bar2","bar 3","bar+4"]
          //and blah blah as many param as things support.
          }
success:
  success: function(data){
          alert(data);
          //function to be executed on true response with response TEXT as argument.
          }

Execution of Callback function on valid response is totally optional , function can take Response text and Response Status as arguments to process on client side.

method:
method:'True For Asyn and False for Non-Async | By default it is True'

By Default Method will be True i.e Async calls . You Can Leave This

debugLog:
debugLog:'True to enable Debug Console Logs | By Default it is False'

By Default Method will be False | You Can Leave This

Example with all arguments

minAjax({
    url:"test.php",//request URL
    type:"GET",//Request type GET/POST
    //Send Data in form of GET/POST
    data:{
      name:"Superman",
      secretname:"Clark Kent",
      profession:"reporter",
      worth:"poor",
      company:"Daily Planet"
    },
    method:"true",
    debugLog:"true",
    //CALLBACK FUNCTION with RESPONSE as argument
    success: function(data){
      alert(data);
    }

  });
  

Fork it , Create Pull

@flouthoc (http://twitter.com/flouthoc)

More Repositories

1

calc.asm

Arithmetic calculator in x86 assembly
Assembly
582
star
2

vas-quod

🚑 Minimal linux container runtime
Rust
441
star
3

wiser

🐎 Extremely minimal vmm for linux written in C. Hopefully someday will spin linux-vm for you.
C
259
star
4

blinkTitle.js

Is a Pure Javascript Implementation of TitleBar Alert or Notification.It Can Perform Blinking of Html Titlebar When Required.
JavaScript
114
star
5

uglipop.js

A Lightweight Non-fancy Modal/Lightbox
JavaScript
91
star
6

scrollpup.js

Minimal beautiful bar to show scroll progress. Pure Javascript Plugin.MIT
JavaScript
86
star
7

envelop.c

🌊 Thread-less, event-loop based tiny http-server from scratch using epoll. Learning Purpose.
C
82
star
8

Gradbar

Gradient Actionbar for your Android-app
Java
71
star
9

minBlock.js

Is a Pure Javascript Canvas Implementation of Matrix Grid ( Primary Application was to Generate Github Like Random Avatar using minBlock.js or Pixel Pattern)
HTML
69
star
10

aku

Aku - Tiny Backtesting/Trading Engine
C++
37
star
11

buha.js

Browser based Strictly ordered Task Queue for Sync/Async Javascript Functions
JavaScript
30
star
12

ztick

tiny desktop utility to keep notes ( with no features ). Written in zig and gtk4
Zig
29
star
13

logr.h

A micro library to create/view logs for your next POSIX thing.
C
13
star
14

commitchart-flutter

Implementation of Github Commit Chart in Flutter. [MIT License]
Dart
12
star
15

oci_lib

oci-image and oci-runtime spec in rust. Un-official mirror of libocispec.
Rust
12
star
16

murmur3-map

Go Fast Object Map based on Murmur3 HashFunction
Go
12
star
17

timenil

Pure CSS responsive timeline mockup. MIT License.
HTML
9
star
18

PerceptRon

🌱 NeuralNetwork01: Lib for Single Perceptron
C++
7
star
19

StickFace

An Awesome DeskTop Sticky Widget which Follows you Everywhere .Written in C language.Built With Gtk For Gnome and Unity Environment.Well Tested Under Ubuntu
C
3
star
20

Echojs.com-API-minimal

A minimal API like Python Wrapper for http://Echojs.com
Python
3
star
21

orc

A micro MVC Framework
PHP
3
star
22

isVideo.js

Javascript to detect if browser supports HTML5 video mp4,ogg,webm playback or not
JavaScript
3
star
23

tessellated-intelligence-system

Segments for TIS-100
Assembly
2
star
24

Pure-JS-Canvas-Image-Crop

This is Implimentation of Image Crop Under HTML5 Canvas. Plugin Has Been Implemented In Pure Javascript , No Dependency Required
JavaScript
2
star
25

dir_tree

A micro python plugin to print directory tree
Python
1
star
26

StickFace2

A Minimalist Sticky Widget THat Follows Your Around Your Work Screen. Built For Gnome & Unity Environment.Built in Python,well tested in Ubuntu
Python
1
star
27

nets

fixed layer neural network
C++
1
star
28

ubuntupaste

a micro plugin written in C to enable cli-interface for pastebin.ubuntu.com
C
1
star