/
Ads Refresh - Ajax V4 (Spaces)

Ads Refresh - Ajax V4 (Spaces)

The functions that allow to refresh ads are the following:


1. eplDoc.epl.reloadSpace(space_id)

It allows to reload one particular space. The space ID must be indicated. The id can be retrieved from the HTML Code view in the system:

Ā 

Ā 

Ā 

Implementation Example:

<html>
<body>

<!-- e-planning v4 - Start of space Site _ Home _ ASM_Space -->
<script language='JavaScript' type='text/javascript'><!--

window.onload = function(){
Ā Ā Ā Ā Ā Ā Ā  timeReload();
}

var eplDoc = document; var eplLL = false;
var eS1 = 'us.img.e-planning.net';var eplArgs = { iIF:1,sV:'http://ads.eu.e-planning.net/',vV:'4',sI:'504',kVs:{}};
function eplCheckStart() {
Ā Ā Ā  if (document.epl) {
Ā Ā Ā  Ā Ā Ā  var e = document.epl;
Ā Ā Ā  Ā Ā Ā  if (e.eplReady()) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  return true;
Ā Ā Ā  Ā Ā Ā  } else {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  e.eplInit(eplArgs);
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  if (eplArgs.custom) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  for (var s in eplArgs.custom) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  document.epl.setCustomAdShow(s, eplArgs.custom[s]);
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  return e.eplReady();Ā Ā Ā  Ā Ā Ā 
Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  } else {
Ā Ā Ā  Ā Ā Ā  if (eplLL) return false;
Ā Ā Ā  Ā Ā Ā  if (!document.body) return false; var eS2; var dc = document.cookie; var ci = dc.indexOf('EPLSERVER=');
Ā Ā Ā  Ā Ā Ā  if (ci != -1) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  ci += 10; var ce = dc.indexOf(';', ci);
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  if (ce == -1) ce = dc.length;
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  eS2 = dc.substring(ci, ce);
Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  var eIF = document.createElement('IFRAME');
Ā Ā Ā  Ā Ā Ā  eIF.src = 'about:blank'; eIF.id = 'epl4iframe'; eIF.name = 'epl4iframe';
Ā Ā Ā  Ā Ā Ā  eIF.width=0; eIF.height=0; eIF.style.width='0px'; eIF.style.height='0px';
Ā Ā Ā  Ā Ā Ā  eIF.style.display='none'; document.body.appendChild(eIF);
Ā Ā Ā  Ā Ā Ā 
Ā Ā Ā  Ā Ā Ā  var eIFD = eIF.contentDocument ? eIF.contentDocument : eIF.document;
Ā Ā Ā  Ā Ā Ā  eIFD.open();eIFD.write('<html><head><title>e-planning</title></head><bo'+'dy></bo'+'dy></html>');eIFD.close();
Ā Ā Ā  Ā Ā Ā  var s = eIFD.createElement('SCRIPT'); s.src = 'http://' + (eS2?eS2:eS1) +'/layers/epl-41.js';
Ā Ā Ā  Ā Ā Ā  eIFD.body.appendChild(s);
Ā Ā Ā  Ā Ā Ā  if (!eS2) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  var ss = eIFD.createElement('SCRIPT');
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  ss.src = 'http://ads.eu.e-planning.net/egc/4/b';
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  eIFD.body.appendChild(ss);
Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  eplLL = true;
Ā Ā Ā  Ā Ā Ā  return false;
Ā Ā Ā  }
}
eplCheckStart();
function eplSetAd(eID) {
Ā Ā Ā  if (eplCheckStart()) {
Ā Ā Ā  Ā Ā Ā  var opts = (eplArgs.sOpts && eplArgs.sOpts[eID]) ? eplArgs.sOpts[eID] : {};
Ā Ā Ā  Ā Ā Ā  if (opts.custF) { document.epl.setCustomAdShow(eID,opts.custF); }
Ā Ā Ā  Ā Ā Ā  document.epl.setSpace(eID, opts);
Ā Ā Ā  } else {
Ā Ā Ā  Ā Ā Ā  setTimeout('eplSetAd(''+eID+'');', 250);Ā Ā Ā 
Ā Ā Ā  }
}
function eplAD4(eID, opts) {
Ā Ā Ā  document.write('<div id='eplAdDiv'+eID+''></div>');
Ā Ā Ā  if (!opts) opts = {t:1};
Ā Ā Ā  if (!eplArgs.sOpts) { eplArgs.sOpts = {}; }
Ā Ā Ā  eplArgs.sOpts[eID] = opts;
Ā Ā Ā  eplSetAd(eID);
}

function timeReload(){
Ā Ā Ā Ā Ā Ā Ā  intervalo = setInterval(
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  function(){
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  eplDoc.epl.reloadSpace('Ā dcaf6e56dd0d2795');
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  },10000Ā 
Ā Ā Ā Ā Ā Ā Ā  );
}


//--></script>
<script>eplAD4('dcaf6e56dd0d2795',{t:1,timeout:0,ma:1,custF:null,sd:'504!!http://ads.eu.e-planning.net/!!'});</script>
<!-- e-planning v4 - End of space Site _ Home _ ASM_Space -->

</body>
</html>

Ā 

References:

Refresh time in thousandths of seconds.Ā 

'Reload' function to add into the code.

ID of the space to rotate.

Ā 

2. eplDoc.epl.refreshAds();

It loads all the spaces in the page.

Ā 

Implementation Example:

<html><body>

<script language='JavaScript' type='text/javascript'><!--

window.onload = function(){
Ā Ā Ā Ā Ā Ā Ā  timeReload();
}

var eplDoc = document; var eplLL = false;
var eS1 = 'us.img.e-planning.net';var eplArgs = { iIF:1,sV:'http://ads.eu.e-planning.net/',vV:'4',sI:'504',kVs:{}};
function eplCheckStart() {
Ā Ā Ā  if (document.epl) {
Ā Ā Ā  Ā Ā Ā  var e = document.epl;
Ā Ā Ā  Ā Ā Ā  if (e.eplReady()) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  return true;
Ā Ā Ā  Ā Ā Ā  } else {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  e.eplInit(eplArgs);
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  if (eplArgs.custom) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  for (var s in eplArgs.custom) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  document.epl.setCustomAdShow(s, eplArgs.custom[s]);
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  return e.eplReady();Ā Ā Ā  Ā Ā Ā 
Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  } else {
Ā Ā Ā  Ā Ā Ā  if (eplLL) return false;
Ā Ā Ā  Ā Ā Ā  if (!document.body) return false; var eS2; var dc = document.cookie; var ci = dc.indexOf('EPLSERVER=');
Ā Ā Ā  Ā Ā Ā  if (ci != -1) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  ci += 10; var ce = dc.indexOf(';', ci);
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  if (ce == -1) ce = dc.length;
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  eS2 = dc.substring(ci, ce);
Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  var eIF = document.createElement('IFRAME');
Ā Ā Ā  Ā Ā Ā  eIF.src = 'about:blank'; eIF.id = 'epl4iframe'; eIF.name = 'epl4iframe';
Ā Ā Ā  Ā Ā Ā  eIF.width=0; eIF.height=0; eIF.style.width='0px'; eIF.style.height='0px';
Ā Ā Ā  Ā Ā Ā  eIF.style.display='none'; document.body.appendChild(eIF);
Ā Ā Ā  Ā Ā Ā 
Ā Ā Ā  Ā Ā Ā  var eIFD = eIF.contentDocument ? eIF.contentDocument : eIF.document;
Ā Ā Ā  Ā Ā Ā  eIFD.open();eIFD.write('<html><head><title>e-planning</title></head><bo'+'dy></bo'+'dy></html>');eIFD.close();
Ā Ā Ā  Ā Ā Ā  var s = eIFD.createElement('SCRIPT'); s.src = 'http://' + (eS2?eS2:eS1) +'/layers/epl-41.js';
Ā Ā Ā  Ā Ā Ā  eIFD.body.appendChild(s);
Ā Ā Ā  Ā Ā Ā  if (!eS2) {
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  var ss = eIFD.createElement('SCRIPT');
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  ss.src = 'http://ads.eu.e-planning.net/egc/4/b';
Ā Ā Ā  Ā Ā Ā  Ā Ā Ā  eIFD.body.appendChild(ss);
Ā Ā Ā  Ā Ā Ā  }
Ā Ā Ā  Ā Ā Ā  eplLL = true;
Ā Ā Ā  Ā Ā Ā  return false;
Ā Ā Ā  }
}
eplCheckStart();
function eplSetAd(eID) {
Ā Ā Ā  if (eplCheckStart()) {
Ā Ā Ā  Ā Ā Ā  var opts = (eplArgs.sOpts && eplArgs.sOpts[eID]) ? eplArgs.sOpts[eID] : {};
Ā Ā Ā  Ā Ā Ā  if (opts.custF) { document.epl.setCustomAdShow(eID,opts.custF); }
Ā Ā Ā  Ā Ā Ā  document.epl.setSpace(eID, opts);
Ā Ā Ā  } else {
Ā Ā Ā  Ā Ā Ā  setTimeout('eplSetAd(''+eID+'');', 250);Ā Ā Ā 
Ā Ā Ā  }
}
function eplAD4(eID, opts) {
Ā Ā Ā  document.write('<div id='eplAdDiv'+eID+''></div>');
Ā Ā Ā  if (!opts) opts = {t:1};
Ā Ā Ā  if (!eplArgs.sOpts) { eplArgs.sOpts = {}; }
Ā Ā Ā  eplArgs.sOpts[eID] = opts;
Ā Ā Ā  eplSetAd(eID);
}


function timeReload(){
Ā Ā Ā Ā Ā Ā Ā  intervalo = setInterval(
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  function(){
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  eplDoc.epl.refreshAds();
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  },10000Ā 
Ā Ā Ā Ā Ā Ā Ā  );
}


//-->

Ā </script>

<script>eplAD4('e91b9c28b317e741',{t:1,timeout:0,ma:1,custF:null,sd:'504!!http://ads.eu.e-planning.net/!!'});</script>

<script>eplAD4('d959ec6eb9e1d175',{t:1,timeout:0,ma:1,custF:null,sd:'504!!http://ads.eu.e-planning.net/!!'});</script>

<script>eplAD4('91015102ceda9dee',{t:1,timeout:0,ma:1,custF:null,sd:'504!!http://ads.eu.e-planning.net/!!'});</script>


</body>
</html>

Ā 

References:

Refresh time in thousandths of seconds.Ā 

'Reload' function to add into the code.

Spaces to reload (they have to belong to the same zone/section)

Related content