Getting Started

Adding SniperJS to Your Web Pages

<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

Example:

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>

Downloading the source code

You can save the source code to be used locally on your project without needing internet connection to always link directly from the servers.

Install package from NPM

npm i js-sniper

Tips for Optimizing SniperJS Integration

  1. Check the Order: Ensure that SniperJS script is the first script included at the end of the body tag to function properly alongside your custom scripts.

  2. Local Backup: Download the SniperJS source code for offline use, reducing dependency on external servers and improving load times.

  3. Version Control: Keep track of the SniperJS version you are using to ensure compatibility with your codebase and easily update when new versions are available.

Last updated