AdFalcon offers Javascript solution for smartphone websites. If you are sure that your site will only be viewed over smartphone devices, you can use the JavaScript integration solution. Otherwise we recommend integrating with AdFalcon network using the server side web integration method explained in the sections below.
Function | Description |
---|---|
adFalcon(key, parameters) key A string containing unique key for an instance in whole page. parameters An object containing AdFalcon required and optional parameters | this function containing a set of member variables and functions these members using to load and render the ads. you do not use these members directly; you just create an instance of AdFalcon function, then use the coming member function to load and render the ads. |
loadAd() | this function is a member function for AdFalcon that is used to load and render the ads. |
To use AdFalcon JavaScript you will need to create three simple script sections as follows:
Note: We highly recommend setting the previous two scripts in the header of HTML page.
<header>
.
.
.
<!-- this section declares the parameters for adFalcon JavaScript, you find these parameters in AdFalcon Mobile Web API document in Appendix A -->
<script type="text/javascript">
var adFalconParameters =
{
R_SID: "Site ID"
, R_TM: true
//Extra optional parameters
//, R_AS:1 //If particular Ad size is requested; otherwise ignore it.
//, R_UUID:"UUID" // If you maintain a unique user id for each user, then provide it here.
//, U_LN: “ar”
//,U_AGE: 27
//,U_G: m
//,U_KW: “sport, music”
//,U_CC: “JO”
//,U_AC: “962”
//,U_PC: “11121”
//,D_LA:35.654
//,D_LO:34.054
}
</script>
<!--this section loads JavaScript of AdFalcon -->
<script type="text/javascript" src="http://www.adfalcon.com/static/js/adfalcon-web-all-1.0.0.js">
</script>
.
</header>
<body>
.
.
<!--Creating new instance of adFalcon function and load the ad-->
<script type="text/javascript">
var adFalconInstance1 = new adFalcon("unique key for this instance", adFalconParameters );
adFalconInstance1.loadAd();
</script>
.
.
function $initHighlight(block) {
if (block.className.search(/\bno\-highlight\b/) != -1)
return false;
try {
blockText(block);
} catch (e) {
if (e == 'Complex markup')
return;
}//try
var classes = block.className.split(/\s+/);
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp start
if (LANGUAGES[classes[i]]) {
highlightLanguage(block, classes[i]);
return;
}//if
}//for
highlightAuto(block);
}//initHighlight
function $initHighlight(block) {
if (block.className.search(/\bno\-highlight\b/) != -1)
return false;
try {
blockText(block);
} catch (e) {
if (e == 'Complex markup')
return;
}//try
var classes = block.className.split(/\s+/);
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp start
if (LANGUAGES[classes[i]]) {
highlightLanguage(block, classes[i]);
return;
}//if
}//for
highlightAuto(block);
}//initHighlight
function $initHighlight(block) {
if (block.className.search(/\bno\-highlight\b/) != -1)
return false;
try {
blockText(block);
} catch (e) {
if (e == 'Complex markup')
return;
}//try
var classes = block.className.split(/\s+/);
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp start
if (LANGUAGES[classes[i]]) {
highlightLanguage(block, classes[i]);
return;
}//if
}//for
highlightAuto(block);
}//initHighlight