jQuery mobile,将样式应用于Windows Phone(mango)上的动态内容

时间:2012-08-07 01:41:10

标签: css windows windows-phone-7 jquery jquery-mobile

我正在动态地向我的网页添加内容(使用AJAX)。除了没有自动应用的样式之外,这样工作正常。对此的修复是使用.trigger("create");(例如$('#content').html(data).trigger("create"))。 这适用于webkit,FF和IE(在PC上),在Windows Phone的IE上它拒绝工作。显示内容,但没有任何(jquery mobile)样式。 我尝试使用.page或使用append代替'html'来添加内容,但似乎没有任何效果。

1 个答案:

答案 0 :(得分:2)

我刚刚解决了我的问题。 trigger("create")工作正常,问题出在jQuery $.ajax({ })调用中。 作为数据类型,我使用文本(dataType: "text",),同时传输HTML。我将dataType更正为html(dataType: "html",),现在它工作得很好。 与Firefox,IE桌面和Chrome

相比,Windows Phone浏览器看起来更严格