Jez D
Jez D

Reputation: 1489

javascript not working on native android browser

I am part way through developing a mobile web app which contains almost no HTML elements. JSON2HTML is used to create HTML elements.

My problem is that it works ok except for on

The problem with these browsers is that the content isn't being rendered.

It works fine on

Just to clarify, this is a mobile web app, not a native mobile app. I am not using any native code, I am using standard web technologies (HTML5, CSS3, jQuery, Javascript, JSON)

Upvotes: 3

Views: 12185

Answers (2)

Jez D
Jez D

Reputation: 1489

After days of research and testing, I have found the solution.

  1. First I activated the built-in debugger on my Android phone - instructions at http://tinyurl.com/768qltl
  2. The debugger then told me that the error was at line 71 of jquery.json2html.js
  3. I opened jquery.json2html.js
  4. I replaced line 71 with the following code
    else $.fn.append.call($(this),$(dom).children());

This works because the previous line 71 was calling the jquery append.apply function, which only works with specific data type on older browsers.

Upvotes: 2

Nick Davis
Nick Davis

Reputation: 204

Your best bet would be finding a way to remotely debug what's happening in the native browser. There are a couple ways to do this.

  • Install an app like JsHybugger, which acts as a reverse proxy
  • Add some new JavaScript to the source page and use Weinre, JSConsole, or to attach remotely

Upvotes: 1

Related Questions