私は誤った質問をしているかもしれませんが、私はまだJavaScriptをかなり新しくしています。私は、ユーザーがオンライン製品デモのために使用する数を再指定するクッキーを作成する必要があります。擬似コードでは、次のようになります。クッキーの値を取得するには?
if(readCookie('demo') == null){
createCookie('demo','1',1);} //Assuming the functions for setting a cookie and retrieving it have already been created.
else {
readCookie('demo');
}
if demo cookie has value{
increment the value by one
}
else if value exceeds 10 {
alert message //I set this so I could test out the function
}
助けていただければ幸いです。
検索:http://stackoverflow.com/search?q=javascript+読み書き+クッキー –
あなたは、ユーザーが自分のクッキーを削除し、何度でも再生できることは自明です。 – jfriend00