Skip to content

Instantly share code, notes, and snippets.

@nikunjkotecha
Created December 19, 2014 13:57
Show Gist options
  • Select an option

  • Save nikunjkotecha/18ce297f8c3b8bfa4ae2 to your computer and use it in GitHub Desktop.

Select an option

Save nikunjkotecha/18ce297f8c3b8bfa4ae2 to your computer and use it in GitHub Desktop.
adRinger JS Code Example
<!-- 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