I have simple functionality to execute a JS method on page load and on the click of a button in page. This works perfectly fine in iPad and other devices whereas I don't see it functional in iPad Mini.

The functions are as follows:

function isDeviceOrWeb() {
    if (/iPad/.test(navigator.userAgent)) {
        console.log("tablet: " + navigator.userAgent);
        return "tablet";
    } else if (/Mobile|Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
        console.log("mobilet: " + navigator.userAgent);
        return "mobile";
    } else {
        console.log("Webt: " + navigator.userAgent);
        return "web";
    }
}

function randomNumber() {
    return Math.floor(Math.random() * 10) + '';
}

function captcha() {
    var a = randomNumber();
    var b = randomNumber();
    var c = randomNumber();
    var d = randomNumber();
    var code = a + ' ' + b + ' ' + ' ' + c + ' ' + d;
    $("#desktopCaptcha").val(code);
    $("#deviceCaptcha").val(code);
    $("#captchaInput").val("");
    $("#inputCaptcha").val("");
}

When I inspected the iPad mini Network console, I found that the custom.js which contains the above functions gets loaded as well

This behavior is for both Chrome browser and Safari browser in iPad Mini, currently my iOS version in iPad mini is iOS 9 (I cannot update as it don't have rights)

Please suggest what could be wrong here.

0

There are 0 best solutions below