最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript not working on native android browser - Stack Overflow

programmeradmin2浏览0评论

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

  • iPad
  • Android 4.0.3 Native browser.

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

It works fine on

  • Android 4.0.3 Chrome,
  • Android 4.0.3 Firefox
  • Android 4.0.3 Opera
  • Android 4.0.3 Dolphin
  • Android 4.1.1 Native
  • Android 4.1.1 Other browsers

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)

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

  • iPad
  • Android 4.0.3 Native browser.

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

It works fine on

  • Android 4.0.3 Chrome,
  • Android 4.0.3 Firefox
  • Android 4.0.3 Opera
  • Android 4.0.3 Dolphin
  • Android 4.1.1 Native
  • Android 4.1.1 Other browsers

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)

Share Improve this question edited Jul 15, 2013 at 10:33 Jez D asked Jul 11, 2013 at 14:09 Jez DJez D 1,4892 gold badges25 silver badges54 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

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./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.

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
发布评论

评论列表(0)

  1. 暂无评论