Question

I want to use xui.js in a mobile web project that needs to work on iOS, Android and Windows Phone 7. The documentation (http://xuijs.com/) is a little unclear as what the different versions include. Does the "ie & ie mobile" version also include the "webkit / firefox / opera" version?

If not, what is the recommended way of delivering the library? I was considering using conditional comments to include the different versions if that is necessary. e.g.

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

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top