/plugin_jquery_ajax

JQuery plugin with ajax implementation.

Primary LanguageHTML

Jquery Ajax Plugin

Codacy Badge

Jquery Plugin with ajax feature, loader transition and history management using history API.

Installation

  • Clone the repository and open it.

    $ git clone https://github.com/alexandre-mace/plugin_jquery_ajax.git
    $ cd plugin_jquery_ajax
    

Getting Started

  • Add the plugin into your HTML file (adjust the location to your needs)
<script type="text/javascript" src="ajaxPlugin.js"></script>
  • Call the plugin in your javascript file
$().ajaxPlugin({
});

Configuration

Here is the default configuration of the plugin

destination: $("body"),
ajaxTriggers: $("a"),
loader: {
    url: "https://loading.io/spinners/coffee/index.coffee-cup-drink-loader.gif",
    style: {
        position: "absolute",
        top: "50%",
        left: "50%",
        transform: "translate(-50%, -50%)",
        visibility: "hidden"
    }
}

Feel free to bypass the default options by giving the plugin brand new options e.g :

$().ajaxPlugin({
    ajaxTriggers: $(".my-own-triggers");
});

Your options will automatically override the existing ones.