我得到這個遺漏的類型錯誤「上」讀取屬性:遺漏的類型錯誤:不能爲空
我不能確定是什麼原因造成,maybes事做與jQuery?
這裏是確切的代碼:
//when add to cart link is clicked...
$('.addtocart').on('click', function(){
//get the value of the "data-value" attribute for that link
var vehicleRegistration = $(this).data('value');
//save it to localStorage
localStorage.setItem('vehicleRegistration', vehicleRegistration);
//read from localStorage
if(localStorage.getItem('vehicleRegistration')){
//add the value to the form input
$('#field34').val(localStorage.getItem('vehicleRegistration'));
}
});
這裏是它發生在頁面:http://drivencarsales.co.uk/book-testdrive
這真是難住我了,如果有人能幫助我解決這個問題,將不勝感激。
謝謝,尼克
,並請把你的HTML元素與此類要麼 –
還請確保您的jQuery的版本是等於或大於'1.7' –
您應該顯示HTML聲明以及 –