refresh a header after adding it dynamically
there are several posts that mention similar problems, but i haven't been able to find anything that solves this. i'm dynamically adding a header to a page. how do i refresh it so that the jquery mobile styles are activated? as some other posts comment on, page() doesn't work. here's my code:
- $(document).ready(function(){
-
- $('div[data-role*="page"]').each(function(i){
- if($(this).children('div[data-role*="header"]').length!=0){
-
- alert("has header");
- }
- else{
- $(this).prepend("<div data-role='header'><h1>Welcome</h1></div>");
- //need to refresh here
- }
- });
- });