A little refactoring.
Got it working without jQuery on iOS and Android.