私は、起動ページを実行する次のコードを持っています。これにより、繰り返しetape.html
でhtmlブロックにhtml要素を挿入できます。n
最初の反復ではすべて問題なく表示されますが、2 回目の反復では div ブロックに何も表示されません。
二次的な考慮事項は、ページをリロードできる「 Suivant 」ボタンを押すと実行されますetape.html
誰かが何か考えがありますか?
index=0;
$("#etape").live('pageshow', function() {
if(index>5)
{
//Go to other Page
}
switch(id_type_champ)
{
case 1:
$('#header-right-container').append(''+nom_champ+'<input type="text" id='+Id+' > ').trigger("create");
alert("case 1");
break;
case 2:
$('#header-right-container').append(''+nom_champ+'<input type="text" id='+Id+' > ').trigger("create");
alert("case 2");
break;
case 3:
$('#header-right-container').append(''+nom_champ+'<input type="date" id='+Id+' OnClick="aff_date(\'' + Id + '\')">').trigger("create");
alert("case 3");
break;
case 4:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0></option></select>').trigger("create");
alert("case 4");
break;
case 5:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 5");
break;
case 6:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 6");
break;
case 7:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 7");
break;
case 8:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 8");
break;
case 9:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 1");
break;
default:
$('#header-right-container').append(''+nom_champ+'<select id='+Id+' ><option value=0> </option></select> ').trigger("create");
alert("case 1");
break;
}
$('#header-left-container').append('<a href="etape.html" data-role="button" OnClick="DoAction()" data-icon="arrow-r" data-iconpos="right" data-theme="a" id="suivant">Suivant</a> ').trigger("create");
}
function DoAction()
{
//$('#'+id+'').val() ; //GET text
//$('#'+id+'').val('AAAAAA'); //SET
index++;
alert('Button has been clicked avec un index = a '+ index);
}