Join Free
  • Non Blocking Performance Ad Code

    We have implemented a more optimal way of adding Performance Ads to your site. With most ad code, the javascript has to load for each ad unit on the page. While the javascript is loading it blocks other page elements from loading. This update loads our js once, and since it is loaded in the head, it prevents our script from blocking the loading of anything else on your page.


    Include the js in the head of your document:
    PHP Code:
    <head>
    ...
    <
    script type="text/javascript" src="http://prosperent.com/js/ad.js"></script>
    ...
    </head> 
    Then add the div element to the body where you want the ads to display:
    PHP Code:
    <body>
    ...
    <
    div class="prosperent-pa" style="height: 200px; width: 300px;" prosperent_pa_uid="[Your UserID]"></div>
    ...
    </
    body
    As you can see, the js variables that you set the old wayare now set as attributes. For example, to add a fallback query, it would look like this:
    PHP Code:
    <body>
    ...
    <
    div class="prosperent-pa" style="height: 200px; width: 300px;" prosperent_pa_uid="[Your UserID]" prosperent_pa_fallback_query="shoes"></div>
    ...
    </
    body
    See the documentation for all available params/attributes...

    This update is backward compatible, so the old way of adding the script tags to the body will still work. This is simply for more advanced users that want to squeeze a little extra performance out of their site.
    Comments 9 Comments
    1. 312k1t's Avatar
      Is there any API for initialization when I add div (element with prosperent attributes) dynamically? I know that Facebook has FB.XFBML.parse() and twitter twttr.widgets.load(). Do you have something similar?
    1. Prosperent Andrew's Avatar
      No, you do not initialize. It will initialize itself in ad.js.
    1. 312k1t's Avatar
      But when I add PA dynamically, then it does not initialize. Check this example http://jsfiddle.net/6DR3s/, after first PA load, then click on load next ad and new PA is added but is empty.
    1. Prosperent Andrew's Avatar
      Send me a url to the site that the ads are on and I will take a look.
    1. AcidRaZor's Avatar
      The first one initializes automatically because the ad.js fired it. The next time you load it, it already done what its supposed to. So it wont fire again. You need to make it process the ad again somehow. So whatever function fired in ad.js to initialize the first one, needs to fire it again
    1. 312k1t's Avatar
      Quote Originally Posted by Prosperent Andrew View Post
      Send me a url to the site that the ads are on and I will take a look.
      I created example http://jsfiddle.net/6DR3s/ , button load next ad simulates dynamically added PA.
    1. Prosperent Andrew's Avatar
      Try the following:

      Code:
      prosperentpa.i();
    1. 312k1t's Avatar
      Updated version with prosperentpa.i(); http://jsfiddle.net/6DR3s/2/ still does not work.

      BTW If it's not possible let it be. Now It's not priority for me.
    1. Prosperent Andrew's Avatar
      I'll take a look at the actual code and try to get that functionality working for you. I'm currently working on a high priority task, so give me some time and I will get back to you on this.
coupons | coupons and deals