Skip to content

EngageDC/autofill.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

autofill.js

Simple Facebook Autofill

Installing

Paste directly after the <body> opening tag.p

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '{your-app-id}',
      status     : true,
      xfbml      : true
    });
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/all.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>
  • Add a reference to this script: <script language="javascript" src="/js/autofill.js"></script>
  • Add the btn-facebook class to your "Autofill with Facebook" button
  • Make sure that the correct id's have been set up on your form fields (e.g. firstname, zip_code, etc.) -- you can also update the references directly in autofill.js
  • You're good to go!

About

Simple Facebook Autofill

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors