0

I need to open my second page (id=objectside) in JQM Mobil after it's been alert in JavaScript:

      function showObjekt(val){
        $.getJSON('getObjectDetails.php?ido='+val, function(data) {
            //Overwrite divs in page objectside with values from json
              objectside.divid.innerHTML=data.value; //example how i overright it
        });
        $.mobile.changePage("#objectside");
  }

As you see i have modified serval divs in the page with the id objectside then I want to load this modified page just like I Would be clickking on link with href="#objectside".
This doesn't work. What I do wrong?

Tiago Sippert
  • 1,324
  • 7
  • 24
  • 33

1 Answers1

0

You have to change the page via jQuery Mobile once you finish the JSON call:

$.getJSON('getObjectDetails.php?ido='+val, function(data) {

           $("#objectside").html(data.value);

           //Change page now
           $.mobile.changePage("#objectside");
        });
Jonathan Naguin
  • 14,526
  • 6
  • 46
  • 75
  • @LukasSchmidinger check my edit and check out that `data.value` contains the correct html... – Jonathan Naguin Jul 01 '13 at 12:30
  • THX a million times but perhabs u can help me with an other little mystery: i change the div linksdiv like this: var links='"; $("#linksdiv").html(links); The first Time I use the function it makes a button (as it should) the following times it just makes a ordinary link. – Lukas Schmidinger Jul 01 '13 at 12:53
  • @LukasSchmidinger you are asking another question, but by far I can read you are not refreshing the listView, try $('#mylist').listview('refresh'); – Jonathan Naguin Jul 01 '13 at 13:02
  • 1
    @LukasSchmidinger please, accept the answer to close the question. – Jonathan Naguin Jul 01 '13 at 13:03