jQuery Ajax Example

by Annie Lagang

HTML

<a class="trigger" href="#">Load Ajax Content</a>
<div id="siteloader"></div>

CSS

html, body {
    height: 100%;
}

div {
    height: 99%;
}

JavaScript

$(function() {
      $('.trigger').click(function(){
          var url = 'https://image.cebupacificair.com/r3.4.6/aboutus/terms-and-condition.html'
          var newHtml = '<object class="externalSource" data="' + url + '" />';
        $("#siteloader").html(newHtml);
        $(".externalSource").css({width : '100%', height : '100%'});
  });
});