norwood451
Technical User
Hi – I was excited to find this great code to solve a problem with users blocking cookies. I added it to a iframe page on my site. In IE7 it works great. It detects if the user has cookies enabled, and if not, within the iframe,, it tells the user what the problem is and how to fix it. If cookies are enabled, it works seamlessly in IE. However, when I tested the page in Safari, and Google Chrome the error page is in the iframe no matter what. Does anyone know why it would work in IE and not Chrome and if so, can you tell me how to rewrite the code to work in both browsers? See code-
Please note: I am entering this code in a Office Live web site, so I am limited to where I can put code. It this case it is added to a “html window / ifram within the page ” , with is the only place html code can be entered with an office web site. Currently, the code is not entered into my web page because it does not work with other browsers, but I can set up a test page, if I need to demonstrate the problem. I have temporally add a link to the page to tell users that cookies need to be enabled –kind of a funky solution.
This is the code I found that I added to my iframe Page – the location can be any page, but the norwood.com page is the one that I am using.
<script type="text/javascript">
if (!document.cookie) {
document.location = "}
</script>
This is how it looks in the html page- (all of the code used) – and works with IE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Arroyo Grande homes & land for sale multiple MLS listings David Norwood central coast real estate California</title>
</head>
<script type="text/javascript">
if (!document.cookie) {
document.location = "}
</script>
<iframe src=" width="843" height="5025"></iframe>
<body>
</body>
</html>
Please note: I am entering this code in a Office Live web site, so I am limited to where I can put code. It this case it is added to a “html window / ifram within the page ” , with is the only place html code can be entered with an office web site. Currently, the code is not entered into my web page because it does not work with other browsers, but I can set up a test page, if I need to demonstrate the problem. I have temporally add a link to the page to tell users that cookies need to be enabled –kind of a funky solution.
This is the code I found that I added to my iframe Page – the location can be any page, but the norwood.com page is the one that I am using.
<script type="text/javascript">
if (!document.cookie) {
document.location = "}
</script>
This is how it looks in the html page- (all of the code used) – and works with IE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Arroyo Grande homes & land for sale multiple MLS listings David Norwood central coast real estate California</title>
</head>
<script type="text/javascript">
if (!document.cookie) {
document.location = "}
</script>
<iframe src=" width="843" height="5025"></iframe>
<body>
</body>
</html>