JavaScript - Javascript Alert + Session Cookie?
I have been looking all over the web for a solution, because my website displays funky in safari. To fix this i figured i'd tell users that if they are using safari, then using javascript, i could tell them a message. Originally i tried detecting safari then displaying a message. But i couldn't ever find a browser detection for safari. So i thought wait....
If i could: 1. get a javascript alert saying my message. 2. time that message alert frequency by a session, say 10 days? or even every browser session... Then i could solve my problem. However i can't figure out any of this. So if anybody would be willing to help, i'd be very grateful. Similar TutorialsHi, I have a website where the user can navigate different categories by tab. The problem is, when they're on a tab other than the default one and they refresh the page or click to another page, it puts them back on the first tab. I know this can be solved by using a session cookie of some type, I just need some help on implementing it into my site. http://www.thatswhyimbroke.com/ - so you can see what i'm talking about. If you look at the different tabs: Price High, price low, food & drink, etc. I want the user to be able to go to one of those, click to page 2 or refresh, and still be on that tab. Any help would be much appreciated! hello everybody, here I'm asking for help again. sorry for that in advance. anyhow, I have the following code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link type="text/css" media="screen" rel="stylesheet" href="colorbox.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="../colorbox/jquery.colorbox.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".example7").colorbox({width:"300px", height:"500px", iframe:true, open: true}); }); </script> </head> <body onload="example7();"> <a class='example7' href="tofes.html"></a> teststestestest </body> </html> I want the lightbox window open only once a day for every unique visitor on my website. I understand I should use some sort of cookie implented, but I dont really understand how to. Thanks in advance, daniel. Hi, I've just written a lovely bit of code where a user sorts a list and then this list is returned to them. Problem is, that I used cookies to do this and I've just found out that cookies are banned for this website - ah! My code is below - can someone please give me some pointers? I've tried a few things but can't get it to work // function that writes the list order to a cookie function getOrder() { // save custom order to cookie $.cookie(setCookieName, $(setSelector).sortable("toArray"), { expires: setCookieExpiry, path: "/" }); } // function that restores the list order from a cookie function restoreOrder() { var list = $(setSelector); if (list == null) return // fetch the cookie value (saved order) var cookie = $.cookie(setCookieName); if (!cookie) return; // make array from saved order var IDs = cookie.split(","); // fetch current order var items = list.sortable("toArray"); // make array from current order var rebuild = new Array(); for ( var v=0, len=items.length; v<len; v++ ){ rebuild[items[v]] = items[v]; } for (var i = 0, n = IDs.length; i < n; i++) { // item id from saved order var itemID = IDs[i]; if (itemID in rebuild) { // select item id from current order var item = rebuild[itemID]; // select the item according to current order var child = $("div.ui-sortable").children("#" + item); // select the item according to the saved order var savedOrd = $("div.ui-sortable").children("#" + itemID); // remove all the items child.remove(); // add the items in turn according to saved order // we need to filter here since the "ui-sortable" // class is applied to all div elements and we // only want the very first! You can modify this // to support multiple lists - not tested! $("div.ui-sortable").filter(":first").append(savedOrd); } } } // code executed when the document loads $(function() { // here, we allow the user to sort the items $(setSelector).sortable({ axis: "y", cursor: "move", update: function() { getOrder(); } }); // here, we reload the saved order restoreOrder(); }); I need a session cookie that way only my lightbox only pops up one time per visit. I have no idea how to do this. Can anyone help? I've searched for session cookies and they only confuse me.
Hi I have create a website where many features do not support IE versions, Can someone help me on javascript code that can alert the user to use Netscape to access my website.. I mean Javscript alert code that will recommend the user to use netscape to access my website .. Any help will be much appreciated Hi, I'm not too familiar with javascript but I am trying to find a script which I can enter a specific time and date and when that date is reached the script will alert me with a desired message. (not looking for a calendar) Help would be appreciated Harry I'm still new to javascript.. My question: How and where do I add an alert that comes up to make sure the user answers all questions before the pop-up window comes up to display score and answers? Here is a link to the quiz Thanks sooo much!! Below is the code.. Code: <script language="javascript" type="text/javascript"> var done = new Array; var yourAns = new Array; var score = 0; function getRBtnName(GrpName) { var sel = document.getElementsByName(GrpName); var fnd = -1; var str = ''; for (var i=0; i<sel.length; i++) { if (sel[i].checked == true) { str = sel[i].value; fnd = i; } } // return fnd; // return option index of selection // comment out next line if option index used in line above return str; } function StatusAllCheckboxes(IDS,cnt) { var str = ''; IDS = 'q'+IDS; var tmp = ''; for (var i=0; i<cnt; i++) { tmp = document.getElementById(IDS+'_'+i); if (tmp.checked) { str += tmp.value + '|'; } } return str; } // function Engine(question, answer, opt, Qtype) { function Engine(question, answer, Qtype) { switch (Qtype) { case "RB" : yourAns[question] = answer; break; case "SB" : yourAns[question] = answer; break; default : yourAns[question] = ''; alert('Invalid question type: '+Qtype); break; } } function EngineCB(question, answer, itemcnt) { // answer is not used at this time yourAns[question] = StatusAllCheckboxes(question,itemcnt); // alert('question: '+question+' :'+yourAns[question]); } //This is the code that calculates the score. function Score(){ score = 0; var tmp = ''; var answerText = "Quiz Results<p>"; // alert('Size of QR: '+QR.length); for (var i=1; i<QR.length; i++) { answerText = answerText+"<br>Question :"+i+" Your answer: "+yourAns[i]+"<br>"; tmp = QR[i][3]; if (QR[i][0] == 'CB') { tmp = tmp+'|'; } // alert(i+' : '+tmp+' : '+yourAns[i]+'\n\n'+answerText+'\n\n'); if (tmp != yourAns[i]) { answerText = answerText+"<br>The correct answer was "+QR[i][3]+"<br>"+explainAnswer[i]+"<br>"; } else { answerText = answerText+" <br>You got this one right! <br>"; score++; } } answerText=answerText+"<br><br>Your total score is : "+score+" out of "+(QR.length-1)+"<br>"; // for varying number of questions, alter scoring var ScoreMax = QR.length-1; var ScoreInc = Math.floor(ScoreMax / 12); // Don't have fewer than 5 questions. answerText=answerText+"<br>Comment : "; if(score<=ScoreInc){ answerText=answerText+"Not quite."; } if(score>=(ScoreInc+1) && score <=(ScoreInc*2)){ answerText=answerText+"Try Again!."; } if(score>=(ScoreInc*2+1) && score <=(ScoreInc*3)){ answerText=answerText+"Rats!."; } if(score>=(ScoreInc*3+1) && score <=(ScoreInc*4)){ answerText=answerText+"Maybe better next time"; } if(score>=(ScoreInc*4+1) && score <=(ScoreInc*5)){ answerText=answerText+"Try Again!"; } if(score>=(ScoreInc*5+1) && score <=(ScoreInc*6)){ answerText=answerText+"I bet you can do better!"; } if(score>=(ScoreInc*6+1) && score <=(ScoreInc*7)){ answerText=answerText+"Hey, pretty good job!"; } if(score>=(ScoreInc*7+1) && score <=(ScoreInc*8)){ answerText=answerText+"You almost got it!"; } if(score>=(ScoreInc*8+1) && score <=(ScoreInc*9)){ answerText=answerText+"Pretty Good! "; } if(score>=(ScoreInc*9+1) && score <=(ScoreInc*10)){ answerText=answerText+"Almost! You can do it!"; } if(score>(ScoreInc*11+1)){ answerText=answerText+"You did GREAT! Congratulations."; } var w = window.open('', '', 'height=500,width=750,scrollbars'); w.document.open(); w.document.write(answerText); w.document.close(); } </script> Code: <form name="myform" class="quiz"> <ol> <script type="text/javascript"> var str = ''; var tmpr = []; var resp = ['True','False']; // allows for up to 10 responses (can have more) for (q=1; q<QR.length; q++) { str += '<li class="quiz">'+QR[q][1]+'</li><br />'; tmpr = QR[q][2].split('|'); switch (QR[q][0]) { case 'RB' : for (var r=0; r<tmpr.length; r++) { str += '<input type="radio" name="q'+q+'" value="'+resp[r]+'"'; str += ' onClick="Engine('+q+',this.value,\''+QR[q][0]+'\')">'; str += ' '+tmpr[r]+'<br />'; } break; case 'CB' : for (var r=0; r<tmpr.length; r++) { str += '<input type="checkbox" id="q'+q+'_'+r+'" name="q'+q+'" value="'+resp[r]+'"'; str += ' onClick="EngineCB('+q+',this.value,'+tmpr.length+')">'; str += resp[r]+' '+tmpr[r]+'<br />'; } break; case 'SB' : str += '<select name="q'+q+'" size="1" id="q'+q+'"'; str += ' onClick="Engine('+q+',this.value,\''+QR[q][0]+'\')">'; for (var r=0; r<tmpr.length; r++) { str += '<option value="'+resp[r]+'">'; str += tmpr[r]+'</option>'; } str += '</select>'; break; /* test code for future entries -- not implemented yet case 'CBM' : break; case 'SBM' : str += '<select name="q'+q+'" size="1" id="q'+q+'"'; str += ' onClick="Engine('+q+',this.value,\''+QR[q][0]+'\')" multiple>'; for (var r=0; r<tmpr.length; r++) { str += '<option name="q'+q+'" value="'+resp[r]+'">'; str += tmpr[r]+'</option>'; } str += '</select>'; break; */ default : str += q+': Invalid type: '+QR[q][0]; break; } str += "<p />"; } document.write(str); </script> <br /> <br /> <input type=button onClick="Score()" value="How did I do?"> </ol> </form> Hi everyone. I need a Javascript code for the following: i have a checkbox on my page. when this checkbox got checked, an alert like "Are u sure?" must ask if OK or Cancel. if i click OK the checkbox becomes checked, it runs a javascript function (chkIt() )and refreshes the page. if i click Cancel the checkbox should not became checked and my function will not run. Thanks a lot. Hi I'm making a php/html page and using javascript to keep a count for me. Code: <script type="text/javascript"> var i=0; }</script> . . . <form action="index.php" method="GET"> <input name="game_button" id="guess1" type = "submit" name="1" value="1" style="height: 50; width: 50; font-size: 16" onClick = "i=i+1;"/> </form> <input type="button" onClick = "alert(i);"/> The last button is just a test button, which will tell me what the value of "i" is, but I'm not getting anything when I cllick that button. However if I change the onClick from alert(i), to alert('i') it will alert me a string, so I know the javascript is working. Any ideas? Hi Guy's, Hope I'm posting in right forum I haven't been here for years I have a program that allows us to insert an alert box on our website triggered by the no right click....... Now we just insert text because the program allows us to but I want to use "&" this is going into a Javascript and it comes out as "&" I know JS uses ampersand I have tried all methods of putting this in but just get & etc...... Any chance someone knows otherwise plz?? Frank hi i am having an issue with javascript on my web site. i am a complete noob at this. the objective is to have the page pop up an alert any time the submit button is pressed: 1st if there is no name on the form the alert says "please enter you first name" and returns a false value to the from 2nd if there is a name on the form the alert is supposed to have a thank you message my problem is that it doesn't show the alert when there is a name here is the code Code: <head> <script type="text/javascript> function write(person) { alert("Thank you for conacting us, "+person+"!"); } function formgo() { var name=document.getElementById('namein').value; if (name==null || name=="") { alert("Please enter your name"); return false; } writety(name); document.forms('contact').reset(); } </script> </head> <body> <form> <fieldset id="contactinfo"> <legend>Contact Details</legend> <label> Name <input type="text" name="name" id="namein" placeholder="First and Last name" /> </label> </fieldset> <fieldset id="submitbox"> <input type="submit" id="submit" value="Submit" onclick='formgo()' /> </fieldset> </form> </body> please reply or email me thank you -misstam Firebug is giving me no error messages, but alert() message is never triggered. I want the alert() message defined below to alert what the value of the variable result is (e.g. {filter: Germany}). And it doesn't. I think the javascript breaks down right when a new Form instance is instantiated because I tried putting an alert in the Form variable and it was never triggered. Note that everything that pertains to this issue occurs when form.calculation() is called: markup: Code: <fieldset> <select name="filter" alter-data="dropFilter"> <option>Germany</option> <option>Ukraine</option> <option>Estonia</option> </select> <input type="text" alter-data="searchFilter" /> </fieldset> javascript (below the body tag) Code: <script> (function($){ var listview = $('#listview'); var lists = (function(){ var criteria = { dropFilter: { insert: function(value){ if(value) return handleFilter("filter", value); }, msg: "Filtering..." }, searchFilter: { insert: function(value){ if(value) return handleFilter("search", value); }, msg: "Searching..." } } var handleFilter = function(key,value){ return {key: value}; } return { create: function(component){ var component = component.href.substring(component.href.lastIndexOf('#') + 1); return component; }, setDefaults: function(component){ var parameter = {}; switch(component){ case "sites": parameter = { 'order': 'site_num', 'per_page': '20', 'url': 'sites' } } return parameter; }, getCriteria: function(criterion){ return criteria[criterion]; }, addCriteria: function(criterion, method){ criteria[criterion] = method; } } })(); var Form = function(form){ var fields = []; $(form[0].elements).each(function(){ var field = $(this); if(typeof field.attr('alter-data') !== 'undefined') fields.push(new Field(field)); }) } Form.prototype = { initiate: function(){ for(field in this.fields){ this.fields[field].calculate(); } }, isCalculable: function(){ for(field in this.fields){ if(!this.fields[field].alterData){ return false; } } return true; } } var Field = function(field){ this.field = field; this.alterData = false; this.attach("change"); this.attach("keyup"); } Field.prototype = { attach: function(event){ var obj = this; if(event == "change"){ obj.field.bind("change", function(){ return obj.calculate(); }) } if(event == "keyup"){ obj.field.bind("keyup", function(e){ return obj.calculate(); }) } }, calculate: function(){ var obj = this, field = obj.field, msgClass = "msgClass", msgList = $(document.createElement("ul")).addClass("msgClass"), types = field.attr("alter-data").split(" "), container = field.parent(), messages = []; field.next(".msgClass").remove(); for(var type in types){ var criterion = lists.getCriteria(types[type]); if(field.val()){ var result = criterion.insert(field.val()); container.addClass("waitingMsg"); messages.push(criterion.msg); obj.alterData = true; alert(result); initializeTable(result); } else { return false; obj.alterData = false; } } if(messages.length){ for(msg in messages){ msgList.append("<li>" + messages[msg] + "</li"); } } else{ msgList.remove(); } } } $('#dashboard a').click(function(){ var currentComponent = lists.create(this); var custom = lists.setDefaults(currentComponent); initializeTable(custom); }); var initializeTable = function(custom){ var defaults = {}; var custom = custom || {}; var query_string = $.extend(defaults, custom); var params = []; $.each(query_string, function(key,value){ params += key + ': ' + value; }) var url = custom['url']; $.ajax({ type: 'GET', url: '/' + url, data: params, dataType: 'html', error: function(){}, beforeSend: function(){}, complete: function() {}, success: function(response) { listview.html(response); } }) } $.extend($.fn, { calculation: function(){ var formReady = new Form($(this)); if(formReady.isCalculable) { formReady.initiate(); } } }) var form = $('fieldset'); form.calculation(); })(jQuery) Thanks for response. What i am trying to do is to make a system on my website that will grab Data from one or two different divs on one page and have it post it in an alert box on the homepage. http://killerz297.webs.com/events.html on that page i would like to be able to have javascript automatically grab the text from the description and paste it into the red box on this page: http://killerz297.webs.com/index.html what i have so far is on this page in the red box i have a script that countsdown how long until the event is away from the set time i put in it until the event starts at a set time it shows the event description, and then while the event is going on it says event in session, then after the event is over it says event no longer ongoing. but then i have to edit the script to the next event. I would like javascript, or what ever type of code it would take to do this to automatically grab the information. I would like for it to automatically switch the information to the next line when the current event is over and start a countdown from there. This is a lot of coding to do but i just am not THAT familiar with how to write javascript to do this myself. One other thing i would likkeeeee is for the red box on home page to disappear until it is 24 hours until next event, and then automatically close 1 hour after event gets over. Not a big deal if i can't get this but i would love it if someone could. okay finally, that is about it lol. If someone could help me with this i would appreciate it soo soo much! Thanks, hope someone could help me. Hello all, Sorry if this may seem like a silly question, I have searched but not really to sure how to word what I am searching for as I don't know if I am going the right way around it! Basically, I am looking to insert a keyword in to a javascript alert box when someone visits my website, so say they came from codingforums.com, it would say "Welcome, CodingForums.com Visitor". My keyword will be passed from the ad platform I am working with and shows up correctly in the tracking, so I'd imagine it's just a case of having the snippet of code for it to show in the alert, correct? If there is no keyword, I would just like it to say "Welcome Visitor" or something. How do I go about this? Thank you in advance for any help. If my php variable, (which is retrieved from a mysql table in the php code, not shown) is equal to "1", that means the member is not eligible to submit the form, so I want an alert() to say "member not eligible!". Else, I want it to continue to submit the form. Here is my code (which I can't seem to get to work): <head> <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript"> function ismaxlength(obj){ var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "" if (obj.getAttribute && obj.value.length>mlength) obj.value=obj.value.substring(0,mlength) } //this first script is for something else, to check the max length of characters in a text area </script> //here is the script in question <script type="text/javascript"> <!-- var mem_eligible = "<?= $is_mem_eligible ?>"; if (mem_eligible == "1") { function MoveOn() { alert('You are not yet eligible, please try again tomorrow!'); } } --> </script> </head> <form name="myform" action="postform.php" method="post" enctype="multipart/form-data"> <div> <input type="submit" name="Submit2" value="Submit Entries" onclick="MoveOn()"/> </div> </form> Please help, thanks! June Hi, I'm having a problem with a website I'm creating for christmas, in my family we always write santa claus letters but with a tricky side to it. So I decided to make questions on a website, the problem is that when the correct answer is given the javascript alert that is supposed to tell the user something appears and disappears without interaction from the user. I need the user to have to click OK. By the way, this only happens when using Mozilla. Bear with me, as I do not know where the problem lies. I know this is a lot of code. I have acquired this code and am not sure what to change to make it work how I want it to. Basically it prompts, with a Javascript alert, for the visitor to take a survey. If they hit OK it redirects them to a landing page, if they hit CANCEL it lets them go on their way. FIRST OFF THANK YOU SOOOO MUCH FOR ANY HELP YOU CAN PROVIDE ME!!! I would like for the script to execute even when the visitor types a URL in the address bar and exits that way versus just alerting the visitor when they click an external link. That is the main goal that I need help with. I would also like the script to use cookies so that it doesn't pop up for a visitor more than once in either 7 or 14 days. This isn't as big of a deal as the problem listed above but is more of a bonus if I can get it. I have listed all pages with code that pertain to this code because, as listed above, I do not know where the problem lies. If it helps, this code is also based off of the jQuery code. Below is the page where the code executes: Code: <html> <head> <script src="SurveyRelocationManager.js"> <!-- --> </script> <script type="text/javascript" src="jquery.js"></script> <script> <!-- var srm; function init(){ srm = new SurveyRelocationManager(); srm.setSurveyURL("http://www.poddcorp.com"); //change to the correct survey URL //add the internal URLs, if internal popup does not deploy srm.addInternalURL("https://secure3.convio.net/ucs/site/Advocacy/"); srm.addInternalURL("http://ucs.convio.net/site/Ecard/"); srm.addInternalURL("https://secure3.convio.net/ucs/site/Donation/"); srm.addInternalURL("http://ucs.convio.net/site/UserLogin/"); srm.addInternalURL("http://ucs.convio.net/site/PageServer?pagename=sign_up/"); srm.addInternalURL("http://www.ucsusa.org/"); $("a").click(function () { return srm.onBeforeClick(this); }); } window.onload = init; --> </script> </head> <body> <a href="http://www.ucsusa.org/internal.html">internal</a><br /> <a href="http://www.themmrf.org/donate-now-take-action/join-an-event/powerful-athletes/mmrf-triathlon-and-cycling.html">external link</a><br /> <a href="internal.html">internal</a><br /> <a href="http://www.yahoo.com">external link</a><br /> <a href="http://www.ucsusa.org/global_warming/">another internal</a> </body> </html> Below is other code (SurveyRelocationManager.js) that helps execute the script: Code: function SurveyRelocationManager(){ //Constr. this.aInternalURLs = new Array(); } SurveyRelocationManager.prototype.init = function(){ this.setInternalURLs(); } SurveyRelocationManager.prototype.setSurveyURL = function(s){ this.sSurv = s; } SurveyRelocationManager.prototype.getSurveyURL = function(){ return this.sSurv.valueOf(); } SurveyRelocationManager.prototype.addInternalURL = function(s){ this.aInternalURLs.push(s); } SurveyRelocationManager.prototype.removeInternalURL = function(s){ for(var a = 0; a<this.aInternalURLs.length; a++){ if(this.aInternalURLs[a] == s){ this.aInternalURLs.splice(a, 1); } } } SurveyRelocationManager.prototype.getInternalURLs = function(){ return this.aInternalURLs.slice(0); } SurveyRelocationManager.prototype.getURLIsInternal = function(s){ var t; /* KLUDGE: t.indexOf returns -1 if aInternalURLs has no slash at the end. Somehow forward slashes cancels the eval. TODO: Refactor t.indexOf. */ for(var a = 0; a<this.aInternalURLs.length; a++){ t = this.aInternalURLs[a]; // if(s.indexOf(t) != -1){ return true; }else if(s.indexOf('http://') == -1) return true; } return false; } SurveyRelocationManager.prototype.onClick = function(o){ var b = this.getURLIsInternal(o.toString()); if(!b){ var c = confirm("Do you want to take the survey?"); if(c){ //TODO: Relocate here. document.location = this.getSurveyURL(); } else { return true; } } else { return true; } return false; } Note: The only other page that isn't located on this post is the jQuery code. Because of it's length it wouldn't allow me to include the code. You can visit jquery.com to view the code. Or message me and I can send it. THANKS A MILLION! is there a way in HTML or Javascript to open a new tab (or new window) and force it to be a new tab (or new window) after alert confirmation of javascript? onclick="window.open('google.com', '_blank'); return false;" OR document.location.href = "google.com"+"&target='_blank'"; not working Code: <?php if ($_POST[oke]) { ?> <script language="JavaScript">alert('thanks'); document.location='google.com' </script> <?php } ?> <form target="_self" method="post"> <input type="submit" name="oke" value="save"> </form> how to put the target _blank Hi, I need to a small task in Javascripts and I would like to know whether this can be done. If someone knows a way that can be done or provide me some code, I would be more greatful. This is the task I need to do :- I have a small shoppig cart. I want when a customer visit the site, if that is his first time on the website and before he quit the browser or go to another URL of another domain or press back and go to another page, an alert should pop up. I have did this using cookies and Javascripts and it is working properly as I wanted. But this alert pops up even when I go inside of my own web. I want this alert only to popup when they leave from my web or go to anyother and it should not popup when I click on my links or go in to my web. I hope, I explained what I want and it is clear. Please if someone knows a solution for this. Please send me your ideas or if you have some codes that can be helpfull to me, please send me. Thank you. Hi, I have a client who has downloadable PDFs on several pages of their site and they want an alert message to come up the very first time they attempt a download from their site. I have found the "alert once message script" in the Javascript Kit, however, the alert message is applicable to each page that has the script on it. Can it be coded so that the alert message only shows on the very first download, no matter which page this is on? Code is as follows: Code: <script> //Alert message once script- By JavaScript Kit //Credit notice must stay intact for use //Visit http://javascriptkit.com for this script //specify message to alert var alertmessage="Welcome to JavaScript Kit! \n http://javascriptkit.com" ///No editing required beyond here///// //Alert only once per browser session (0=no, 1=yes) var once_per_session=1 function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function alertornot(){ if (get_cookie('alerted')==''){ loadalert() document.cookie="alerted=yes" } } function loadalert(){ alert(alertmessage) } if (once_per_session==0) loadalert() else alertornot() </script> Thanks, Wizard247 |