我有一个工作中的HelloWorld phonegap程序,其中涵盖了jquery mobile,具体描述可以参考此处:http://jquerymobile.com/demos/1.1.0/docs/about/getting-started.html。我在其中加入了一些JavaScript来尝试跨域资源共享:
<script>
$(document).bind("pageinit", function() {
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
$.mobile.changePage("http://jquery.com");
});
</script>
在模拟器上(2.3版本),jquery.com可以正常加载jquery mobile演示。然而,在实际的2.3安卓设备上(运行Cyanogen的T-mobile G2、Galaxy SII和Galaxy Player),changePage()调用没有任何反应。