JQM Theme after AJAX call from database
Hello, i got a page where i can enter a city. This city is passed the the next html file, and a ajax request getting results via a php skript from my server. This works well, but only without jqm theme. If i refresh the second result page in my browser, the theme applies. Can you help me to fix that? The Theme needs to be applied without browser refreshing. Here is my code:
THE RESULT HTML FILE:
- <body>
- <div data-role="page" id="event">
- <script>
- $(document).delegate('#event', 'pageshow', function () {
- showEvents();
-
-
- });
- </script>
- <!-- header -->
- <div data-role="header" data-position="fixed">
- <h1>tell the dj</h1>
- </div>
- <!-- /header -->
-
- <!-- content -->
- <div data-role="content">
- <a href="index.html" data-role="button" data-transition="slide">zurück</a>
-
- <div id="events">
-
-
- <p id="load">events in deiner nähe werden geladen</p>
- <img src="../img/loader.gif">
- </div>
- </div>
- <!-- /content -->
-
- </div>
- <!-- /page -->
- </body>
THE showEvents() FUNCTION
- function showEvents(){
- var eingabe = window.location.search;
- var stadt = eingabe.substring(7, 20);
- if (stadt=="")
- {
- document.getElementById("events").innerHTML="";
- return;
- }
- xmlhttp=new XMLHttpRequest();
- xmlhttp.onreadystatechange=function()
- {
-
- if (xmlhttp.readyState==4 && xmlhttp.status==200)
- {
- document.getElementById("events").innerHTML=xmlhttp.responseText;
- }
-
- }
-
- xmlhttp.open("GET","http://dev.tellthedj.de/db/getevents.php?q="+stadt,true);
- xmlhttp.send();
- }
My php script works fine.
Thank you in advance!