私はjQueryモバイルを使用しているモバイルWebアプリケーションを持っています。私はTwitters APIを使用してユーザーを登録し、ログインします。jQuery Mobile + Twitter oAuth
私は、ボタンを持つスプラッシュ画面があります。ボタンをクリックすると、それは、OAuthのスクリプトに指示します。
<?php
require("lib/twitteroauth.php");
session_start();
// The TwitterOAuth instance
$twitteroauth = new TwitterOAuth('YOUR_CONSUMER_KEY', 'YOUR_CONSUMER_SECRET');
// Requesting authentication tokens, the parameter is the URL we will be redirected to
$request_token = $twitteroauth->getRequestToken('http://glnce.com/oh/login.php');
// Saving them into the session
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
// If everything goes well..
if($twitteroauth->http_code==200){
// Let's generate the URL and redirect
$url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
header('Location: '. $url);
} else {
// It's a bad idea to kill the script, but we've got to know when there's an error.
die('Something wrong happened.');
}
?>
私はスプラッシュページからボタンをクリックしたときに、私はエラーを取得しますが。これはPHPエラーではありませんが、私はそれがjQuery Mobileの問題であると仮定しています。私はヘッダーを変更しようとしているので、私はまたそれを仮定しています。
ヘッダーを$ urlに変更してSafariを開かずに自分のWebアプリケーションに残す方法について考えてみましょうか?
私はこれがあいまいであることを知っていますが、それをどのように説明すればいいのか分かりません。私はちょうどそれが新しいウィンドウを開くことなくこのスクリプトを実行する必要があります。
ありがとうございます!
エラーは何ですか? – abraham
それは言わない。私はそのjqueryモバイルエラーと思う。 – Chris
何も言わないとエラーが発生していることをどのように知っていますか? – abraham