I’m dynamically adding content (using AJAX) to my pages. This is working fine, except for the styling, which is not applied automatically. The fix for this is to use .trigger("create"); (e.g. $('#content').html(data).trigger("create") ).
This works on webkit, FF and IE (on PC), on Windows Phone’s IE it refuses to work though. The content is displayed, but without any (jquery mobile) styling.
I tried using .page or use append instead of the ‘html’ to add content, but nothing seems to work.
I’m dynamically adding content (using AJAX) to my pages. This is working fine, except
Share
I just solved my question. The
trigger("create")worked fine, the problem was in the jQuery$.ajax({ })call.As datatype I used text (
dataType: "text",), while transferring HTML. I corrected the dataType to html (dataType: "html",) and now it works just fine.It looks like the Windows Phone browser is more strict on this compared to Firefox, IE desktop and Chrome