这是我的代码。它每次都会提醒()的NaN。
function updateScore(action){
var cookieArray = document.cookie.split(";");
var encodedURL = cookieArray[2];
var decodedURL = decodeURIComponent(encodedURL);
//check if cookie exists
if (decodedURL == "undefined"){
setCookie("rrcookie_score","0",1)
}
var oldScore = decodedURL.split('=');
//alert(oldScore[1]);
var oldScoreInt = parseInt(oldScore);
var newScore = oldScoreInt + 1;
alert(newScore);
}