Ich will eine Zahl (Beispiel 50) innerhalb eines Javascripts in einem Cookie abspeichern, und durch "alert" aufrufen. Im IE bekomme ich mit folgendem Script genau die Zahl 50 auf das alert-Fenster. Beim Firefox bekomme ich jede Menge Mist, wie hier zu sehen.
http://gotthalmseder.lima-city.de/cookie.gif
Was mache ich falsch? Hier das Script:
<html>
<head>
<script type="text/javascript">
function showcookie() {
document.cookie = 50;
alert (document.cookie);
}
</script>
</head>
<body>
<button onclick="showcookie()">Showcookie</button>
</body>
</html>
http://gotthalmseder.lima-city.de/cookie.gif
Was mache ich falsch? Hier das Script:
<html>
<head>
<script type="text/javascript">
function showcookie() {
document.cookie = 50;
alert (document.cookie);
}
</script>
</head>
<body>
<button onclick="showcookie()">Showcookie</button>
</body>
</html>