Long time ago, we talked about using JSONP to tackle to cross domain ajax issue.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP
But this requires server side coding. If you are allow to edit the Apache config, you can simply Enable the CORS (Cross-origin resource sharing) in the VirtualHost file as follow.
1. Enable the mod_headers in Apache by entering the following command in shell.
Continue reading Apache – Enable Cross-origin resource sharing CORS
A few days ago i posted an article about making a JSON request using $.getJSON().
jQuery & JSON – Make JSON GET request using jQuery.getJSON()
But i have made a mistake there because i didn’t realize the Cross Domain problem. So this article shows you how to resolve the Cross Domain issue in $.getJSON() by JSONP. Continue reading jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP