The First Face++ JavaScript Program

Click here to download JavaScript SDK. Have a look at "demo.html". Notice that you should add jQuery if you want to run it using an old version browser.   Set up basic page framework.
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Face++ JavaScript SDK</title>
    </head>
    <body>
        <!-- For output results -->
        <pre id="response"></pre>
 
        <!-- Import libraries -->
        <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
        <script type="text/javascript" src="facepp-sdk.min.js"></script>
 
        <script type="text/javascript">
            // Your JavaScript code for the application
        </script>
    </body>
</html>
Initialize API Object.
var api = new FacePP('0ef14fa726ce34d820c5a44e57fef470',
                     '4Y9YXOMSDvqu1Ompn9NSpNwWQFHs1hYD',
                     { apiURL: 'http://apicn.faceplusplus.com/v2' });
Call the Detection request.
api.request('detection/detect', {
  url: 'http://cn.faceplusplus.com/static/resources/python_demo/1.jpg'
}, function(err, result) {
  if (err) {
    $('#response').text('Load failed.');
    return;
  }
  $('#response').text(JSON.stringify(result));
});
Google+