Skip to content

garybunofsky/pass.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pass.js

Very simple parameter passing.

Pass.js is a way to send or 'pass' url parameters to form fields. In other words, it captures strings from an address bar and sets them as form values. Great for tracking where your leads are coming from.

Usage

  1. Include the javascript in your documents <footer>
<footer>
  <script type="text/javascript" src="pass.js"></script>
</footer>
  1. Set the id of your field. Also set this id in pass.js.
  document.getElementById('your-id').value = getParameter('campaign');
  1. Finally you will want to specify the string you are parsing for.
  document.getElementById('your-id').value = getParameter('your-string');

Full example:

<!-- In your footer -->
<script type="text/javascript" src="pass.js"></script>

<!-- In your form-->
<input id="your-id" name="your-id" type="text"/>
<!-- In your pass.js file-->
document.getElementById('your-id').value = getParameter('your-string');

License

Pass.js is licensed under the MIT license.

About

🏈 Very simple parameter passing. Easily track query strings through form fields - great for PPC campaigns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published