1.1.1 • Published 4 months ago

fmihel-ajax v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

ajax v1.0

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

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 <path-of-index.php>/path1/path2

<?php
    use fmihel\ajax\ajax;
    error_log(print_r(ajax::$data,true));
    ajax::out('hi, from server');
?>

index.php

<?php

require_once __DIR__.'/vendor/autoload.php';

use fmihel\ajax\ajax;

if (ajax::enabled()){
    ajax::init();
    require_once ajax::module();
    ajax::done();
};

?>
1.1.1

4 months ago

1.1.0

4 months ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago