oldarney Posted October 23, 2005 Share Posted October 23, 2005 i cant make this work i need to put a cookie in the users computer when they see the flash intro and then redirect them to the home page when they come again.i took this script from the js tutorials and tweeked it to work for me but my tweeking is really lousy i think its a syntax error or somthing help!!! <html><head><script type="text/javascript">function getCookie(c_name){if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } }return null}function setCookie(c_name,value,expiredays){var exdate=new Date()exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000))document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate)}function checkCookie(){username=getCookie('username')if (username!=null) {a href="#http://www.w3schools.com"}else { username=("youve been here") if (username!=null||username!="") { setCookie('username',username,365) } }}</script></head><body onLoad="checkCookie()"></body></body></html> Link to comment Share on other sites More sharing options...
actionsketch Posted October 23, 2005 Share Posted October 23, 2005 the following line wont work in java script: {a href="#http://www.w3schools.com"}to redirect the user, you have to do:window.location.href="http://www.w3schools.com"; Link to comment Share on other sites More sharing options...
oldarney Posted October 23, 2005 Author Share Posted October 23, 2005 o thank you thank you thank you so much great it works!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now