1) Script Title: Drop-in content box v2.0
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici.../dropinbox.htm
3) Describe problem: Session only cookie does not work in IE 8 and less. Here's an updated version of the script which corrects that:
dropincontentbox.js
Only the set cookie function is changed. It's changed to assure that one of the persistent modes is in play (day, hr or min) before attempting to calculate an expiration date:
Code:dropincontentbox.routines={cookiere: /^(\d+)(day|hr|min)$/, //re to parse duration if not 'session' -jdsgetCookie:function(Name){ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair if (document.cookie.match(re)) //if cookie found return document.cookie.match(re)[0].split("=")[1] //return its value return null }, setCookie:function(name, value, duration){ var expirestr='', expiredate=new Date()if (typeof duration!=="undefined" && (duration=dropincontentbox.routines.cookiere.exec(duration))){ //if set persistent cookie and not session -jds var offsetmin=duration[1] * (duration[2]==='hr'? 60 : duration[2]==='day'? 60*24 : 1)expiredate.setMinutes(expiredate.getMinutes() + offsetmin) expirestr="; expires=" + expiredate.toUTCString() } document.cookie = name+"="+value+"; path=/"+expirestr } }



Reply With Quote
Bookmarks