Using JS/JQuery to serve ads from a self-hosted advertisements solution
A few suggestions:


A function declaration is a bit simpler and more robust regarding hoisting compared to a function expression which assigns an anonymous function to a variable.
Supplying null as the first callback parameter on success is a bit quirky, either always supply the HTTP status or fail silently without calling the callback. If needed you can always introduce an error callback which might be called on xhr.onerror, too.
The async parameter of xhr.open defaults to true and can be removed
Your getAds function could be split into a generic getJSON function and a getAd function which supplies the specific ad URL to the former.
Your current getAds callback requires knowledge about the specific JSON returned by your ad server. This logic should be part of your "rw-ads.js" library and e.g. become part of the new getAd function.


Exemplary code:

function getJSON(url, success) {
  var xhr = new XMLHttpRequest();
  xhr.open('get', url);
  xhr.responseType = 'json';
  xhr.onload = function() {
    if (xhr.status === 200) {
      success(xhr.response);
    }
  };
  xhr.send();
};

function getAd(id, success) {
  getJSON('http://localhost/ads/complete/index.php/ads/adjson/' + id, function(data) {
    if (data.success) {
      success('&lt;a href="' + data.ad_url + '"&gt;&lt;img style="max-width: 100%;" src="' + data.ad_banner + '"&gt;&lt;/a&gt;');
    }
  });
}

getAd(1, function(html) {
  document.getElementById('ad1').innerHTML = html;
}


General considerations:

Since you don't rely on an external ad network but a self-hosted solution, you might want to inject your ads into your HTML document on the server side, without the asynchronous client side ajax request.