Luk*_*sky 6 html javascript android cordova azure-mobile-services
我安装了最新的PhoneGap版本(3.3),打包了我的移动服务HTML应用程序并点击了已知的授权问题:
仅从http://和https:// URL支持登录.请将您的页面托管在Web服务器中
我已经在互联网上搜索了这个问题(http://social.msdn.microsoft.com/Forums/windowsazure/en-US/a2386093-73cd-44fb-a418-4fa83a36c800/phonegap-apps-using-the-new-html -client-for-azure-mobile-services-not-working?forum = azuremobile)但该解决方案对我不起作用.该项目由phonegap参考创建,<script type="text/javascript" src="phonegap.js"></script>但即使我将其更改为<script type="text/javascript" src="cordova.js"></script>它也无效.
这个问题有什么解决方案吗?
我的源代码:
<html>
<head>
<meta charset="utf-8" />
<title>Report</title>
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<script type="text/javascript" src="cordova.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.1.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="myscript.js"></script>
</head>
Run Code Online (Sandbox Code Playgroud)
myscript.js
var app = {
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
var client = new WindowsAzure.MobileServiceClient(
"https://myapp.azure-mobile.net/", "XXX");
client.login("google").done(....
},
};
$(document).ready(function documentReady() {
app.initialize();
});
Run Code Online (Sandbox Code Playgroud)
显然,PhoneGap 3不会window.device.cordova在移动服务检查它的情况下报告其版本.但即便假装也无济于事 - 经过Google授权后,它会进入空白页面.
| 归档时间: |
|
| 查看次数: |
885 次 |
| 最近记录: |