Question

Je souhaite utiliser xui.js dans un projet Web mobile qui doit fonctionner sur iOS, Android et Windows Phone 7. La documentation (http://xuijs.com/) est un peu incertaine car les différentes versions incluent.La version "Ie & Ie Mobile" comprend-elle également la version "Webkit / Firefox / Opera"?

Sinon, quelle est la manière recommandée de livrer la bibliothèque?J'avais envisagé d'utiliser des commentaires conditionnels pour inclure les différentes versions si cela est nécessaire.par exemple.

<!--[if IE]>
<script src="xui-ie.js"></script>
<!-- <![endif]-->

<!--[if !IE]>
<script src="xui.js"></script>
<!-- <![endif]-->    

Était-ce utile?

La solution

I haven't investigated this much myself yet, but I've found others approaching it conditionally, like you: http://danny-t.co.uk/index.php/2012/03/10/conditionally-loading-xui-js-for-webkit-blackberry-or-ie/

Having quickly looked at the source of the ie- and the webkit/ff/opera-version it appears that the IE-version is somewhat tailored for IE, and will have issues if used on the other engines.

An example is the implementation of on in the IE-version, that uses attachEvent which is IE-only (maybe also Opera), and so wouldn't work on FF, Safari etc.

So in my opinion, it does look like you're on the right path.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top