So, i have a site that grabs data from another one of my sites and displays it accordingly. Things are starting to slow down as there is now a lot of data and the query i have grabs all results. So its time to implement some pagination.
Here is my jQuery to grab the data:
jQuery(document).ready(function(){
jQuery(document).on('click','.show_more',function(){
var ID = jQuery(this).attr('id');
jQuery('.show_more').hide();
jQuery('.loding').show();
jQuery.ajax({
type:'POST',
async: true,
crossDomain : true,
url:'http://example.com/retailers/products.php?apikey=123456&retailer=Test',
data:'id='+ID,
success:function(html){
jQuery('#show_more_main'+ID).remove();
jQuery('.retailitems').append(html);
}
});
});
});
With the above i get the following error:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
I know i can use datatype: jsonp
but is there an alternative i can use, as i own the other domain? Is there something i can setup on the other domain to allow this?