How do I get jQuery working on the ANT Galio brows

2019-08-06 11:46发布

I'm developing a web application and would like to use the jQuery library to ease development.

This application will be run on an embedded device running the ANT Galio browser.

The User-Agent string for the device I'm testing against is:

Mozilla/5.0 (compatible; ANTGalio/2.1.19.12.020.2.0.00; vxWorks-6.3)

When I try to run a page using jQuery on this device however it fails silently. Based on the help from @Adam Terlson I've determined that jQuery 1.6.1 does not load correctly on this browser out of the box based on the fact that neither $ nor jQuery is defined after loading the library (both are defined testing the page in Firefox).

Does anybody have any experience using jQuery in the ANT Galio browser? Is it possible to get it running or am I out of luck?

5条回答
看我几分像从前
2楼-- · 2019-08-06 12:06

ANT Galio doesn't like jQuery, there are a number of reasons but none will provide a means to overcome this problem. Javascript to ECMA 1.2 is your best bet.

查看更多
叛逆
3楼-- · 2019-08-06 12:21

strange but I have found on xerox(Ant Galio Browser) weblet that have jquery http://www.support.xerox.com/support/xerox-connectkey-apps/software/enus.html you just need to rename files to zip

查看更多
淡お忘
4楼-- · 2019-08-06 12:23

It is bad idea to use any existing libraries on ANT Galio, especially ver 2.x. Libraries like jQuery cover cross-browsers compatibility (you don't need it) and put easy to use API on the top. Performance is the second thing.

jQuery uses extremely slow selector engine Sizzle. I think this is main reason why you wont be able to use jQuery there.

For example accessing DOM elements using Sizzle is about 100 times slower then pure JS.

IMHO only one way to programming for ANT Galio browser is using JavaScript.

查看更多
ゆ 、 Hurt°
5楼-- · 2019-08-06 12:27

Djquery-1-11-1

1) at jQuery.ready.promise

// Use the handy event callback
document.addEventListener("DOMContentLoaded", completed, false);

// A fallback to window.onload, that will always work
window.addEventListener("load", completed, false);

ANT Galio Browser will not work with window.addEventListener, works only document.addEventListener. DOMContentLoaded event not supported.

2) div.setAttribute(eventName, "t");

Does not assign a value to the attribute and therefore get an error support[i + "Bubbles"] = div.attributes[eventName].expando === false;

3) jQuery.Callbacks

Some kind name conflict with list variable(maybe name restriction). Just need to rename the variable(for example myList).

查看更多
等我变得足够好
6楼-- · 2019-08-06 12:28

Just stick with jQuery 1.3.2 and it will work smoothly, even on the ANT platform. Anything above won't work, as core selectors have been changed and kill performance on ANT.

查看更多
登录 后发表回答