2
내부 JSON 내가 다시 JSON을 조회 할 JQuery와 함수를 호출 할는 함수 자체 여기
$('#page_job_list_pages').live('pageshow',function(){
try {
$.ajax({
url: "http://domain.com/json/" + encodeURIComponent(tid),
type: 'get',
dataType: 'json',
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('page_job_list_pages - failed to retrieve pages');
console.log(JSON.stringify(XMLHttpRequest));
console.log(JSON.stringify(textStatus));
console.log(JSON.stringify(errorThrown));
},
success: function (data) {
$("#page_job_list_pages_list").html("");
$.each(data.nodes,function (node_index,node_value) {
console.log(JSON.stringify(node_value));
if(node_index != 0) {
var companyName = node_value.node.field_basic_info.match("Company:(.*)date");
$("#page_job_list_pages_list").append($("<li></li>",{"html":"<a href='#node_view' id='" + node_value.node.Nid + "' class='page_job_list_pages_list_title'>" + companyName[1] + "</a>"}));
}
});
$("#page_job_list_pages_list").listview("destroy").listview();
$("#page_job_list_pages_list").append('<a onclick="()" data-role="button" data-theme="a">TEST</a>');
}
});
}
catch (error) { alert("page_job_list_pages_list - " + error); }
});
this line is a button
$("#page_job_list_pages_list").append('<a onclick="()" data-role="button" data-theme="a">TEST</a>');
에게 반환하는 웹 서비스를 호출하는 코드 버튼에서 JQuery와 함수를 호출.
어떻게해야합니까?
지금 무엇을하고 싶습니까? 귀하의 질문이 필요한만큼 구체적이지는 않습니다. 'pageshow'에서 실행 한 후에 메소드를 다시 실행 하시겠습니까? –
버튼을 클릭 한 후 다시 실행하십시오. – hkguile
아래에 추가 한 코드를 참조하십시오. –