Jump to content

netvillage

Approved members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by netvillage

  1. If I click an ad on a page it opens the ad target url in a new tab as expected. If I click another ad, or the same ad, on the same page again, it opens a new tab, HOWEVER, the new page target is NOT the ad target. Rather, it is the original page reloaded.

    Is this normal behavior? It's probably rare, but I'd thought I'd mention it.
    I'm using async JS tags.

  2. Actually Here's the same improved a little bit. didn't need the separate DIV for script

    <div id="myad"></div>

    <button type="button" onclick="rotateAd('myad',2)">Rotate Ad</button>
    <script>
    function rotateAd(addiv,zone) {
      // Remove old ad
     $( "#"+addiv ).empty();
     window.reviveAsync={};
     
     // Create new ad
     //   <ins> element
     var ins = document.createElement('ins');
     ins.setAttribute('data-revive-zoneid', zone);
     ins.setAttribute('data-revive-id', 123456789');
     document.getElementById(addiv).appendChild(ins);
     
     //   <script> element
     var s = document.createElement("script");
     s.type = "text/javascript";
     s.src = "//xxxxr/www/delivery/asyncjs.php";
     s.innerHTML = null;
     document.getElementById(addiv).appendChild(s); 
    }
    </script>
     

     

  3. It seemed to be a popular question on here but no solution, so I came up with something that seems to work pretty good. It uses a few jquery lines and doesn't use iframes or force a page refresh. Enjoy!

    <div id="myad"><ins data-revive-zoneid="2" data-revive-id="123456789"></ins></div>
    <div id="adScript"><script async src="http://xxxxx/www/delivery/asyncjs.php"></script></div>

    <button type="button" onclick="rotateAd('myad')">Rotate Ad</button>
    <script>
    function rotateAd(addiv) {
    // Remove old ad
     $( "#"+addiv ).empty();
     $( "#adScript" ).empty();
     window.reviveAsync={};
     
     // Create new ad
     //   <ins> element
     var ins = document.createElement('ins');
     ins.setAttribute('data-revive-zoneid', '2');
     ins.setAttribute('data-revive-id', 'de77d907e60f2f4544b2c1842c4e97ea');
     document.getElementById(addiv).appendChild(ins);
     
     //   <script> element
     var s = document.createElement("script");
     s.type = "text/javascript";
     s.src = "xxxxxx/www/delivery/asyncjs.php";

     s.innerHTML = null;
     document.getElementById("adScript").innerHTML = "";
     document.getElementById("adScript").appendChild(s); 
    }
    </script>
     

    Just noticed I should prob make a parm out of the zone id

     

    Oh I just used a button to test. The rotateAd should be on a timer of some sort

  4. It seemed to me that in async.js the line

    g.loc = d.location.href;
    was used to pass up a parameter of "&loc=" to the asyncspc.php which I figured was used as some sort of key to link to the website url there to generate the counts. I went with that code assumption and it seemed to be ok. Sounds like it may not have been needed. thank you.

  5. So for someone coming along reading this, it looks like x-forwarded-protocol has something to do with load balancers.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto

    I'm not using one BUT I think my requests are being forwarded anyways. I am testing my Phonegap/cordova app using the Ripple browser plugin, I bet that does some forwarding. And when my app, built via phonegap build with hydration mode... I guess there's some forwarding there too.

    So my hacked solution for now is to update the setupConfigVariables() function, and set

    $GLOBALS['_MAX']['SSL_REQUEST'] = false;

    Guess I won't be able to do any SSL requests but I don't think I will anyways.

  6. New user running v4.0.2 running on Apache, PHP 5.5.12 and MySQL 5.6.17

    Using the "Asynchronus JS Tag" my http calls (non-ssl), keep attempting to grab the image as https and the lg.php file as https.
    It works on one page (site), but another it fails (inside the ripple emulator for Phonegap, and also my phonegap app). works in IE.

    Here's the tag I am using where I hardcoded the http: (I don't want the slowdown from ssl)

    <ins data-revive-zoneid="1" data-revive-id="de77d907e60f2f4544b2c1842c4e97ea"></ins>
    <script async src="http://ads.xxxxxx.com/adserver/www/delivery/asyncjs.php"></script>

    Some notes:

    -If I use the regular "javascript tag" (the one with the document.writes) it works fine.

    -if I do alert(location.protocol); it is "http"

    -If I edit the file asyncspc.php and change the MAX_commonConstructSecureDeliveryUrl() function from https to http, that part works, so for some reason I'm thinking that big check at the top of the file ((!empty($_SERVER['SERVER_PORT ']) && !empty($GLOBALS['_MAX ']['CONF ']['openads ']['sslPort '])....etc) which sets

     "$GLOBALS['_MAX ']['SSL_REQUEST ']"

    somehow was invoked.

     

    Perhaps some default configuration settings?

     

     

×
×
  • Create New...