小编Sur*_*rya的帖子

如何使用Phonegap for Android调用远程API?

如何使用Phonegap在Android应用程序中进行远程API调用?

android android-applicationinfo cordova

6
推荐指数
2
解决办法
1万
查看次数

AngularJS 中的 $http 错误处理

我的 AngularJS 项目中的 $http 无法识别 iOS 上的 40X(401,403,405...) 错误。我使用的是 1.2.10 AngularJS 版本和 Cordova 3.4.0 版本。

下面是我正在使用的代码:

TE_SERVICES.factory('hello',function ($http,$rootScope) {
return {
loginUser: function(userCredentials,successCallback,errorCallback){
          $http({
               method: "GET",
               url: "data/example.json",
               headers: {"Authorization":'Basic '+userCredentials},
             }).then(function(response){
                                successCallback(response.data);
                                console.log("Success------"+JSON.stringify(response))
             },function(data, status, headers, config){
                                errorCallback(data);
                                console.log("Error------"+JSON.stringify(data)+" "+status)
             })

        }
    }
 });

hello.loginUser($rootScope.encodedUserCredencials,function(persons) {
                // success handler
            }, function(data) {
                // error handler
                console.log(data.status+"===="+status)
                });
Run Code Online (Sandbox Code Playgroud)

data.status返回 0,状态返回未定义。请帮我解决这个问题。

试图将域包含在 IOS 的白名单中。但没有解决方案:( 它仍然给出相同的响应。

但是相同的代码在 Android 中运行得非常好。请帮我解决这个问题。

提前致谢 :)

ios angularjs cordova-3 angularjs-http

3
推荐指数
1
解决办法
2万
查看次数

如何在Jquery Mobile中定义文本区域的高度和宽度?

在输入之前,输入字段是预定义的大小(屏幕宽度上的两行).. :(它没有采取我在行和cols值中定义的任何内容.例如:仍然输入的数字是固定的...显示没有变化.

渐渐地,随着我们介绍文本,输入字段的高度增加,以查看整体介绍的文本.

但我需要的是定义我自己的textfeild的高度和宽度......如果输入的文本更多,逐渐增加的数量应该增加.

我正在使用的代码是:

<div data-role="content">
<form method="post" name="login" data-ajax="false">
<label for="textarea"><h3><u>Add Comment</u> : </h3></label>
<textarea cols="8" rows="50" name="textarea" id="comment">
</textarea>
</form>
<div>
Run Code Online (Sandbox Code Playgroud)

jquery jqueryform jquery-mobile

1
推荐指数
1
解决办法
2万
查看次数