I put a checkbox on my webpage, but I want to check it, base on the content of the text file. I am using the below code:
$(document).ready(function(){
$.ajax({
url : "CH1.txt",
dataType: "text",
success : function (data) {
$("CH1.text").html(data);
var jsonData = JSON.parse(data);
alert(data);
if(data=="1"){$("#CH1CheckBox").prob('checked', true);
else $("#CH1CheckBox").prob('checked', false);
}
});
});
when I remove the below script that belonged to JQuery mobile, everything is ok.
but when I use the JQM it not works. I already test with the .attr() function as well, but not constructive. please help. thanks in advance
Aucun commentaire:
Enregistrer un commentaire