I'm developing Phonegap App with JqueryMobile.i want to create a dynmaic list that show each element
I have 3 html files and 1 php file: index.html > list.html > details.html JS is inside html files.
I use jquery-1.6.4.min.js & jquery.mobile-1.4.5.min.js
index.html:
...
HTML
...
<script>
$(document).ready(function(){
$("#button").click(function(){
$.post("myURL", {myparameters}, function(data) {
var obj = jQuery.parseJSON(data);
for (i = 0; i < obj.length; i++){
var lista = $("\
<td style='width:100px;height:100px' >\
<a href='details.html' id='details' class='details' value='"+obj[i]["id"]+"'>\
<img style='width:100px;height:100px' src='"+image+"'>\
</a>\
</td>");
list.appendTo("#...");
}
});
});
});
</script
>
list.html:
...
HTML
...
<script>
$(document).ready(function(){
$(".details").click(function(){
$.post("myURL", {myparameters}, function(data)
{
*Here I load details data*
});
});
});
</script>
Problems/Questions:
$(document).ready(function){...}; load dynamic list only once.When i go to other menu,data from list.html dissapear.
When I click in some element from list.html,jquery code dont load data in details.html
JQ 1.6.4 & JQM 1.4.5 are okey?
I know that i do something wrong about read the document.I read JqueryMobile documentation and I tried other methods like:
$(document).on('pagecreate',function()...
$(document).on('pagebeforecreate',function()...
$(document).on('pageinit',function()...
but didn't work so help me Masters of JQ and JQM D: