Ajax not working ((

19 views
Skip to first unread message

111c...@gmail.com

unread,
Feb 27, 2015, 11:20:18 AM2/27/15
to phon...@googlegroups.com
 Request dont work on real device after phonegap build but its works fine if i use phonegap desktop app with that device and also works fine in desktop browser.   


Ajax request(try vanila too, not working):

 $("#post-request-btn").on("click", function() {
            log.write('post-request-btn clicked');

           $.ajax({
                url: 'http://jetty/mysite/api/user/login',
                dataType: 'json',
                type: 'POST',
                contentType: "application/x-www-form-urlencoded; charset=utf-8",
                data:  'email=testuser&password=111',
                crossDomain: true,
                success: function (res) {
                    log.write('!!!success!!!');
                    log.write(res);
                },
                error: function (mod, res) {
                    log.write('errorrrrrr');
                    log.write(res);
                    log.write(mod);
                }
            });
        });
Reply all
Reply to author
Forward
0 new messages