コード例 #1
0
ファイル: index.php プロジェクト: wkgg/uberHacker
    <?php 
define('APP_DIR', dirname(__FILE__));
require_once APP_DIR . '/action/weixin.php';
require_once APP_DIR . '/action/uber.php';
$appid = 'wx895ed4a1115b7e54';
$appsecret = 'd4624c36b6795d1d99dcf0547af5443d';
$weixin = new Weixin($appid, $appsecret);
$uber_appid = 'cmLDMkZ4cr9rivGlPd8Z6AQM-gdwiU2t';
$uber_appsecret = 'q7ImotFQf1BsgKhsT0STUrq0Vd8IquRSpcoBdS4A';
$uber = new Uber($uber_appid, $uber_appsecret, 'profile');
if (get('code') && get('state') == 'authorization') {
    $uber->oauth();
    exit;
}
$uber->gotoOAuth();
$jsSDK = $weixin->getJsApiConf();
?>

    <script>

        var UberHackthon = {
            ajax : function( url, data, callback, method, errorCallback ) {
                var xhr = new window.XMLHttpRequest;
                var sdata = data || '' ;
                xhr.onreadystatechange = function(){
                    if ( xhr.readyState == 4 ) {
                        if( xhr.status == 200 ) {
                            typeof callback == 'function' && callback.call( null, xhr.responseText );
                        } else if( xhr.status==0 ) {
                            typeof errorCallback == 'function' && errorCallback.call( null, xhr.responseText );
                        }