Page cover

SniperJS Intro

The purpose of Sniper.js is to make it much easier to use JavaScript on your website.

What You Should Already Know

Before you start studying sniper.js, you should have a basic knowledge of:

  • HTML

  • CSS

  • JavaScript

About Sniper.js

  • SniperJs is a JavaScript Library.

  • SniperJs greatly simplifies JavaScript programming.

  • SniperJs is very easy to learn.


What is SniperJs?

SniperJs is a lightweight, "code smarter, build faster", JavaScript library.

The purpose of Sniper.js is to make it much easier to use JavaScript on your website.

SniperJs takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.

SniperJs also simplifies a lot of the complicated things from JavaScript, like DOM manipulation, AJAX, Location API, powerful utility functions and many more.

snipper.js
$('.button').addClass("active");
Regulator Javascript
document.getElementsByClassName("button")[0].classList.add("active")

Linking Sniper in your HTML

<script src="https://cdn.jsdelivr.net/npm/js-sniper/dist/sniper.min.js"></script>
  • Paste this script tag at the end of your document body </body>

  • This tag has to come first before your own script tags

index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <title>Test Page</title>
     <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>Hey there, I'm using SniperJS in this Website</h1>

    <div>
        <input type="checkbox" name="" checked id="cb">
        <textarea name="" id="">Lorem ipsum, dolor sit amet consectetur adipisicing  </textarea>
    </div>

    <script  src="https://cdn.jsdelivr.net/npm/js-sniper/dist/sniper.min.js"></script>
    <script src="myScript.js"></script>
</body>
</html>

SniperJS — Code smarter, build faster!!!

Last updated