2011-12-13 111 views
0

以下腳本適用於所有瀏覽器和設備,但自iOS 5發佈以來,它不再有效。jQuery腳本不適用於iOS 5

以下代碼計算輸入的日期,以便我可以將它們發送到表單中。但是,現在日期顯示爲NaN。

不能明白爲什麼。

 function makeUpDates(){ 
      // concantenate values to date_start and date_end hidden inputs 
      var dateString = document.getElementById('date').value, 
      date = new Date(dateString); 

      document.getElementById('date_start').value = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + ("0" + date.getDate()).slice(-2); 

      var numDays = document.getElementById('slider').value; 
      date.setDate(date.getDate() + parseInt(numDays)); 

      var dateEnd = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + ("0" + date.getDate()).slice(-2); 
      document.getElementById('date_end').value = dateEnd; 
     } 

回答

1

問題是我遺失了輸入上的覆蓋代碼。這是從來沒有與其他瀏覽器的問題,只是在iphone上iso5

<script> 
//reset type=date inputs to text 
$(document).bind("mobileinit", function(){ 
$.mobile.page.prototype.options.degradeInputs.date = true; 
});  
</script> 
+0

你有沒有在iOS 5上發現任何其他奇怪的,相關的解決方法?例如。我在這裏[這個問題](http://stackoverflow.com/questions/9210015/jquery-ajax-stopped-working-with-ios-5-0-1) – 2012-02-09 11:28:57

相關問題