PHPackages                             fmihel/ajax - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fmihel/ajax

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fmihel/ajax
===========

ajax responser of apache/php server

v2.0.3(1mo ago)01.2k↓25%1MITPHP

Since Apr 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fmihel/ajax)[ Packagist](https://packagist.org/packages/fmihel/ajax)[ RSS](/packages/fmihel-ajax/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (24)Used By (1)

ajax v1.2
=========

[](#ajax-v12)

Install
-------

[](#install)

```
$ npm i fmihel-ajax
$ composer require fmihel/ajax
```

run script for remove js files from vendor path

```
$ cd ./vendor/fmihel/ajax && ./composer-after-install.sh && cd ../../../
```

Simple use
----------

[](#simple-use)

file struct

```
path
  |-path1
  |   |-path2
  |       |-mod.php
  |-index.php
  |-client.js

```

`client.js`

```
import ajax from 'fmihel-ajax';

ajax::send({
    to:'path1/path2/mod',
    data:{ msg: 'send msg to server',any_num:10,arr:[1,32,4,2]},
})
.then(data=>{
    console.info(data);
})
.catch(e=>{
    console.error(e);
});
```

`mod.php` in folder `/path1/path2`

```
