문제

iOS, Android 및 Windows Phone 7에서 작업 해야하는 모바일 웹 프로젝트에서 xui.js를 사용하고 싶습니다. 문서 (http://xuijs.com/)는 다른 버전에 포함 된 것처럼 조금 불분명합니다....에"IE & IE 모바일"버전에는 "WebKit / Firefox / Opera"버전이 포함되어 있습니까?

그렇지 않은 경우 도서관을 배달하는 권장 방식은 무엇입니까?조건부의 주석을 사용하여 다른 버전을 사용하여 필요한 경우 다른 버전을 포함시키고있었습니다.예를 들어,

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

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top