Changeset 371


Ignore:
Timestamp:
01/29/2010 01:32:25 AM (2 years ago)
Author:
ofer
Message:

Allow our ajax to work cross-domain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_ajax.php

    r365 r371  
    2020 * This file handles various AJAX needs of our plugin 
    2121*/ 
     22// The following headers allow for cross-domain posting here, which is useful for some weird sites 
     23header('Access-Control-Allow-Origin: *'); 
     24header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); 
     25header('Access-Control-Allow-Headers: X-Requested-With'); 
     26header('Access-Control-Max-Age: 86400'); 
     27 
     28// Exit early so the page isn't fully loaded for options requests 
     29if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') { 
     30    exit(); 
     31} 
     32 
    2233// we need wordpress and us... 
    2334require_once('../../../../wp-load.php'); 
Note: See TracChangeset for help on using the changeset viewer.