Created
December 19, 2014 14:01
-
-
Save nikunjkotecha/2dab61da9886ec8b9ca2 to your computer and use it in GitHub Desktop.
adRinger JS Code Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- adRinger JS library --> | |
| <script type = "text/javascript" src= "http://prod-test-1.callsrv.in/callsrv.js?ver=1.0" ></script> | |
| <script type = "text/javascript" > | |
| /* JSON object to define Parameters for reporting */ | |
| var params= {'customparam1' : 'customvalue1', 'customparam2' : 'customvalue2'}; | |
| var settings = { | |
| "params" : params, // Optional, Custom parameters(in JSON format), Type : String, Default : null | |
| "replace" : "my-id", // Optional, ID of HTML element to replace Number in that element once number is assigned, Type : String, Default : null | |
| "callback" : "callback", // Optional, Custom Callback function, Type : String, Default : null | |
| "autodial" : true // Optional, False if you want to disable autodial, Type : String, Default : true | |
| }; | |
| /* Call adRingerGetNumber function to initiate the process. */ | |
| adRingerGetNumber("548ee94e1a1f46a44060aa6c", settings); | |
| /* Advertiser's function to handle number. */ | |
| function callback(data) { | |
| /* | |
| Add your code here | |
| data.formatted -> This will give you number in +1-XXX-XXX-XXXX format | |
| data.number -> This will give you number in +1XXXXXXXXXX format | |
| */ | |
| alert(data.formatted); | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment