Đinh Carabus
Đinh Carabus

Reputation: 3496

Why is this code not working on the iPad Pro? (JS)

Basically my code looks like this:

var settings = JSON.stringify({
    foo: $.sessionStorage.get("foo"),
    bar: $.sessionStorage.get("bar"),
});
$.post(this.baseUrl + "&action=saveData", {"data": settings}, function () {
    window.location = self.printUrl + "&data=download";
});

So first I grab some things from the session storage, stringify them, then post this data to the server. After this is done window.location is set to a download-url - the browser receives a pdf. This works on all browsers so far except for the iPad Pro - where nothing happens. I don't know how to debug JS on the iPad, so I don't know exactly where this code fails. Does anyone have an idea what might be the possible cause of this problem? How can I debug JavaScript on the iPad?

Upvotes: 0

Views: 550

Answers (1)

Marcio
Marcio

Reputation: 2107

To debug JavaScript on the iPad you need to use the Web Inspector from a Mac on OSX.

To do so:

  1. On the iPad: Enable Web Inspector (Settings > Safari > Web Inspector)
  2. On the Mac: Open Safari, go in Preferences > Advanced, then select "Show Develop Menu"
  3. Plug the iPad on the Mac.

You should now see your iPad on the Develop menu from Safari OSX.

Upvotes: 1

Related Questions