troubleshooting Question

Display HTML instead of Alert

Avatar of patelajk
patelajk asked on
1 Comment1 Solution261 ViewsLast Modified:

I have some code which displays an alert if Cookies are disabled. how can i modify this so that it displays an message in a label or in a <p> tag

E.g if cookies disbaled, show the below:

<p>Please Enabled Cookes...</p>

Thanks in advanced

<script language="JavaScript">
function cc()
 /* check for a cookie */
  if (document.cookie == "") 
    /* if a cookie is not found - alert user -
     change cookieexists field value to false */
    alert("COOKIES need to be enabled!");
    /* If the user has Cookies disabled an alert will let him know 
        that cookies need to be enabled to log on.*/ 
    document.Form1.cookieexists.value ="false"  
  } else {
   /* this sets the value to true and nothing else will happen,
       the user will be able to log on*/
    document.Form1.cookieexists.value ="true"
/* Set a cookie to be sure that one exists.
   Note that this is outside the function*/
document.cookie = 'killme' + escape('nothing')
// -->
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros