Call Jquery and ajax between two different domain (cross-domain)


If You have to call one page index.htmlfrom to
then You have to add code given below in top of index.html file of in the top

switch ($_SERVER['HTTP_ORIGIN']) {
case '': case '':
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type');

and call jquery or ajax in page of

It will be allow to access to access via ajax/jquery cross domain.