cookie script below (normal) and An altered version of the cookie script 'forever' Which will not expire but require deletion from the users pc.
I need help to alter the cookie code below NOT to expire.
I need help to write a javascript to switch between the two according to user prefrence (checkbox checked)
The idea I have for the switching code will switch from one url to the other accordingly.
If the user checks 'normal' it will use the url below of the normal script below.
[since this is built in it must be over ridden if 'forever' checked'
If the user checks 'forever' it will use the url of the altered script (as yet undefined. I will host it) so the switching code must allow for me to add the forever cookies script url.
I want the 'forever' box checked by default.
Can some smart coder please please write these codes for me?
url of normal cookies script
http://static.1.ipbfree.com/external..._jq_cookies.js
normal cookies script
Expand|Select|Wrap|Line Numbers
- jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
- var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
- expires='; expires='+date.toUTCString();}
- var path=options.path?'; path='+options.path:'';var domain=options.domain?'; domain='+options.domain:'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
- return cookieValue;}};
Expand|Select|Wrap|Line Numbers
- <form style="display: inline;" action="http://inny.ipbfree.com/index.php?act=Login&CODE=01&CookieDate=1" method="post"> <div align="center"><strong>Quick Log In</strong> <input class="forminput" size="20" name="UserName" onfocus="this.value=''" value="User Name" type="text"> <input class="forminput" size="20" name="PassWord" onfocus="this.value=''" value="ibfrules" type="password"> <input class="button" src="http://inny.ipbfree.com/uploads/ipbfree.com/inny/emo-up.gif" type="image"> </div> </form>