hallo zusammen,
ich habe hier
http://www.webreference.com/javascript/961125/part03.html
eine nuetzliche seite gefunden und nach meinem nutzen angepasst.
leider funktioniert das nicht wie es soll
koenntet ihr mir bitte auf die spruenge helfen
******************** cookie-welcome.js ************************
<!--
/* This code is Copyright (c) 1996 Nick Heinle and Athenia Associates,
* all rights reserved. In order to receive the right to license this
* code for use on your site the original code must be copied from the
* Web site webreference.com/javascript/. License is granted to user to
* reuse this code on their own Web site if and only if this entire copyright
* notice is included. Code written by Nick Heinle of webreference.com.
*/
function getCookie (name) {
var dcookie = document.cookie;
var cname = name + "=";
var clen = dcookie.length;
var cbegin = 0;
while (cbegin < clen) {
var vbegin = cbegin + cname.length;
if (dcookie.substring(cbegin, vbegin) == cname) {
var vend = dcookie.indexOf (";", vbegin);
if (vend == -1) vend = clen;
return unescape(dcookie.substring(vbegin, vend));
}
cbegin = dcookie.indexOf(" ", cbegin) + 1;
if (cbegin == 0) break;
}
return null;
}
function setCookie (name, value, expires) {
if (!expires) expires = new Date();
document.cookie = name + "=" + escape (value) +
"; expires=" + expires.toGMTString() + "; path=/";
}
function delCookie (name) {
var expireNow = new Date();
document.cookie = name + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/";
}
function toggleWelcome() {
if (getCookie(cookieName) == "true") setCookie(cookieName, "false", top.expdate);
else setCookie(cookieName, "true", top.expdate);
}
function offTemp() {
if (getCookie(cookieName) == "true") {
setCookie(cookieName, "offtemp", expdate);
history.go(0);
}
}
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
var cookieName = "BenimWelcomeDeneme";
var welcomePage = "main.htm";
if (getCookie(cookieName) == null || getCookie(cookieName) == "true") {
setCookie(cookieName, "true", expdate);
document.write ('lt;FRAMESET ROWS = "100%, *" FRAMEBORDER = NO BORDER = 0gt;');
document.write ('lt;FRAME SCROLLING = AUTO SRC = "' + welcomePage + '"');
document.write ('MARGINWIDTH = 5 MARGINHEIGHT = 5gt;');
document.write ('lt;/FRAMESETgt;');
}
else if (getCookie(cookieName) == "offtemp") {
setCookie(cookieName, "true", expdate);
}
// -->
******************** welcome.htm ******************************
<script type="text/javascript" language="JavaScript" src="cookie-welcome.js"></script>
<body bgcolor="yellow">
<FORM>
<INPUT TYPE = "checkbox" onClick = "top.toggleWelcome()">
Don't show this welcome screen again.
</FORM>
<br>
<A HREF = "javascript:top.offTemp()">
temporarily disabling the welcome & enter main page
</A>
*********************** main.htm *********************************
<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript" language="JavaScript" src="cookie-welcome.js"></script>
</HEAD>
<BODY bgcolor="orange">
This is the normal Page.
</BODY>
</HTML>
****************************************************************
herzlichen dank im voraus
gruss