npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@belharradi.j/ajaxios

v2.2.0

Published

sending ajax with form

Downloads

84

Readme

Ajaxios

no more coding to sending a simple library Based on your HttpClient request to sending request ajax using from it's very simple that's can be used with Jquey,Angular,Vuejs,Rectjs

-> Requirements

  Ajxios have no requirements that by default it's require just http api 
  you can use any of this api 
  HttpClient for Angular 
  Jquery.ajax for Jquery
  Axios,or fecth for Reactjs,Vuejs
 

-> Installation

 the installaion is simple
 
 npm install @belharradi.j/ajaxios
 
 ------------ or ----------

 include in head tag the script 
 
 <script src="https://unpkg.com/@belharradi.j/ajaxios"></script>
 

-> Documentation

the usage it's simple just follow the steps

-> Create a form html

    <form action="host/pah" method="GET" id="form">
    
              <label> input filied </label>
              
              <input type="text" name="input" value=" text ..."/>
              
              <input type="button"  id="send" value="send">
    </form>

-> Create A instance of Ajaxios

      for create a instance of ajaxios
        var ajax= new Ajaxios(options,requirements ={});
        options it's a object like :
        {
        eleform:document.getElementById('form'),// element of form
        http:axios,// http api used for sending request like httpclient,$.ajax,axios
        type:"Axios"// type of Object http it can be ["Axios","Jquery.ajax","HttpClient","fetch"] 
        headers:{Authorization:"toke",
                ............
        },// object of headers 
        }
        for Requirements look at validation step
        

-> Appending data

      you can append data to Ajaxios before you sending
     
     var ajaxios.append(
     {
       keys_parameter:value,
       ..................
       ..................
     }
     );

-> Validation

     the amazing thing it's you testing data in real Time editing by user before sending 
     request will be send if all function of the keys_parameter return true
     requerments = {
       keys_parameter:(values_of_key)=>{
          
          if (values_of_keys.length>0)

                return 1
           else 
                return 0;
       },
       ..................
       .................
      }
      

-> Sending request

      before you sending the request you can execute a function passing as arguments for method send
      
      the function send return A promise Http Object like Httpclient, $.ajax, fetch or axios
      
      document.getElementById('send').click=()=>{
      
      ajaxios.send().then(function(res){

           document.getElementById('send').innerHTML="send"

      });
      }
      or 
        document.getElementById('send').click=()=>{
      
      ajaxios.send(()=>{
             
             ...............
      
      }).then(function(res){

           document.getElementById('send').innerHTML="send"

      });
      }
      

      if you want to use http api just call ajax.http