我需要一些jqueryMobile應用程序的幫助。問題與jquery手機,功能不工作
http://www.mandinker.com/proyects_vip_dev/app-llarjove/
- 在這個環節,你會發現一些箱子,點擊名爲 「CALENDARIO」 框。
- Okey,一切正常,然後按下dropfoot並轉到「INICIO」。
- 再次做第一步,去「CALENDARIO」,和田田,錯誤!
這裏的錯誤:
TypeError: calendario is not a function
...".ui-page-active .calendario").size()){calendario();$( "#datepicker").datepicke...
這裏是相關的源代碼:
$(document).delegate('.ui-page-active', 'pageshow', function() {
if($(".ui-page-active .calendario").size()){
calendario();
$("#datepicker").datepicker();
}
});
function makecalendar(){
$("#datepicker").datepicker();
}
function calendario(){
makecalendar();
$.ajax({
type: "POST",
url: "http://llarjove.softonthecloud.net/calendar",
data: {},
error: function(){},
success: function(data) {
calendario=data;
$(".calendario ul.ui-listview").html("");
$("td").attr("class","ui-datepicker-unselectable");
noticias=data.news;
$.each(noticias,function(key,value){
tmp=value.fecha.split(" ");
tmp=tmp[0].split("-");
$("td[data-month="+(parseInt(tmp[1])-1)+"][data-year="+tmp[0]+"] > a").filter(function(){
tmp[2]=tmp[2].replace(/^0+/, "");
if($(this).text()==parseInt(tmp[2])){
return $(this).text()==parseInt(tmp[2]);
};
}).css({"background":"#00cae8","color":"white"}).attr("href","./calenItem.html?fecha='"+value.fecha+"'").on("click",function(){window.location.href = "./calenItem.html?fecha='"+encodeURIComponent(value.fecha)+"'";});
});
},
dataType: "json",
async: false
});
setInterval(function(){
$(".ui-datepicker-calendar").height($(window).height()-$(".ui-header").height()-120);
},300);
}
任何想法?
是在$(文件)中)calendario功能。就緒(函數({ ..}); ? – system7
或者你也必須把你的函數放在委託函數中。 – system7
函數不在委託和$(document).ready(); datepicker也給我一個錯誤,但datepicker是另一個.js,所以我需要一些重新加載我的.js當應用程序給我一個錯誤 – QuemaGalletas