JSON에 의해 생성 된 listview가 있지만 모든 목록 항목 요소를 포함하도록 div 태그를 동적으로 만드는 방법을 알지 못합니다. CSS 형식이없는 목록처럼 보입니다. 내가 뭘 잘못하고 있는지 모르겠다. 이것은 문제 페이지입니다. http://mbeta.calvaryccm.com/#teachings 이것은 다음과 같이 표현하고자합니다 : http://mbeta.calvaryccm.com/ 필자는 필자가 필요로하는 것을 보여주기 위해리스트 뷰의 형식을 지정하는 방법을 모르겠습니다.jQuery Mobile JSON 형식화
0
A
답변
3
당신이, 당신이 초기화하거나 목록보기 새로 고침해야합니다 (아약스를 통해) 동적 콘텐츠를 추가하는 경우 :
$('#mylist').listview();
// or if you already have a listview that you are appending to
$('#mylist').listview('refresh');
가에서 Calling the listview plugin 참조 페이지 하단
0
글쎄, 나는 여기에 전체 코드를 작성할 수 없습니다하지만 난이 같은 것을 쓸 필요가 되리라 확신합니다 ". ATTR (
// i assume your JSON response is stored in data object
// following is the loop which reads the data object ,gets the value and append it to the `<li>` of `<ul>`
var에 목록 = $ (")를 "ID를", " 명부"); // JQuery와 동적으로 새로운 UL 요소를 만들
for(var i=0;i<data.length;i++)
{
var li=$("<li/>").html(data[i].name); // get the value of name in JSON and put it in newly created li ,(getting value will depend on your json string format)
$("#list").append(li); //append li to ul of id list
}
$(body).append(list); // append the list to anywhere you want, i am appending it to body.
관련 문제
- 1. jquery mobile json filter?
- 2. 형식화 JSON 배열 출력
- 3. JSON 데이터 형식화
- 4. PHP JSON 배열 형식화
- 5. JSON 데이터에서 Jquery Mobile Navbar를 동적으로 작성하십시오.
- 6. jquery mobile 및 json in Rails 사용
- 7. Jquery Mobile 사전로드 페이지
- 8. PhoneGap + jQuery Mobile + cakePHP
- 9. jQuery Mobile HTTPS
- 10. JQuery Mobile 및 JSONP
- 11. jQuery Mobile 페이지 이동하지 않음
- 12. JQuery Mobile 중첩 목록을 사용하여 중첩 JSON 문자열을 표시하려면 어떻게해야합니까?
- 13. jquery mobile 및 json 콜백 결과가 표시되지 않습니다.
- 14. JQuery Mobile 페이지 쇼() 이벤트에서 JSON 데이터에 액세스
- 15. 간단한 JSON 예제가 작동하지 않습니다. PHP, JQuery-Mobile
- 16. jquery mobile 및 phonegap addJavascriptInterface
- 17. jQuery + jQuery Mobile + Chrome 20
- 18. yii 및 jquery mobile
- 19. Styling JQuery Mobile Theme
- 20. 이상한 Jquery-mobile 문제
- 21. JQuery Mobile 제출 양식
- 22. 방향이있는 jQuery Mobile changePage
- 23. jQuery Mobile - 이벤트 바인딩
- 24. 보안 jQuery Mobile + Phonegap
- 25. jQuery Mobile : 목록보기의 대안
- 26. JQuery Mobile PDF 뷰어
- 27. JQuery Mobile : 이미지 확대
- 28. jquery mobile issues
- 29. 메시지로드 중 Jquery mobile
- 30. JQuery Mobile Redirect Help
효과가 있습니다. 도와 줘서 고마워! –