This is a migrated thread and some comments may be shown as answers.

Ios on beforeSend setRequestHeader, btoa issue

1 Answer 71 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bimar
Top achievements
Rank 1
Bimar asked on 19 Feb 2014, 11:49 AM
I have ajax code in my script. Problem is when request start, after beforeSend part ajax code ends (out of the ajax scope). It is not going into error or success part on Ios. But on android it is working properly. Do you have any idea why? I suspect setRequestHeader or btoa methods

 $.ajax({
                url: connectionString ,
                type: "GET",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                beforeSend: function (xhr) {
                    alert("before send");
                    xhr.setRequestHeader('Authorization',
                        "Basic " + btoa(username+ ":" + password));
                   
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert("error");
                    ...
                    

                },
                success: function (a) {
                    alert("success");
                    ...

                }
            });

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Feb 2014, 03:21 PM
Hello Bimar,

We're not aware of such a problem. If the problem occurs only on iOS device, you can debug directly on the device to see what is going wrong. Check out the following links in our documentation for more information:

You can also setup Fiddler to intercept your device's traffic which would give you a clue what's going on with any server/device communication.

Regards,
Steve
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
Tags
Report a bug
Asked by
Bimar
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or