0

I am trying to change content of a div in html. So I have this div with the id contentindex and I want to load the htmlsnippet from offline/indexoffline.html in there.

I tried to do it with $loadlike that:

$("#contentindex").load("offline/indexoffline.html", function() {
});

This correctly loads the content, but it doesn't show the content in jQuery css. So I have jQuery Mobile css and js in the head of my index and on the index it loads correctly, but as soon as I use this $load it dies..

I hope someone can help, I am really suffering on that. :(

Thank you!

  • The jQuery Mobile css. Well what I mean is that the next content I load in the div isn't applied with the jQuery Mobile stylesheet. – user2437856 Jun 28 '13 at 23:00
  • Now I understand. Well, this is the expected behavior and your question is a duplicate of this: http://stackoverflow.com/questions/7999436/jquery-mobile-does-not-apply-styles-after-dynamically-adding-content – Aurelio De Rosa Jun 28 '13 at 23:04

1 Answers1

0

Use .trigger("create") on new contents in jQuery mobile. It will enhance the elements using jQuery mobile css.

dejavu
  • 3,236
  • 7
  • 35
  • 60