|
<Script language=javascript> <!-- function SetCookie(name,value,expiredays) {var ExpireDate = new Date(); ExpireDate.setTime(ExpireDate.getTime()+(expiredays*24*3600*1000)); document.cookie=name+"="+escape(value)+((expiredays==null)?"": ";expires="+ExpireDate.toGMTString());} //--> </script> |
The argument expiredays is better to be passed as Integer, as is a little difficult to let the interpreter do it also with the eval() method. |
| The addings ( to retrieve desired values ) Top |
|
This code is to be added to main Script after all variables of loop and before the closing of the loop-body self. if(the_info=="WebSite") {if(i==1)break; document.forms.monitor.txtM.value=the_value} if(the_info=="username") {if(i==2)break; document.forms.monitor.txtM.value=the_value} if(the_info=="VisitCount") {if(i==3)break; document.forms.monitor.txtM.value=the_value} if(the_info=="the_info") {document.forms.monitor.txtM.value=separated_values[0]+'; '+separated_values[1]+'; '+separated_values[2]+';'} |
This is an alternative code : if(the_info=="WebSite") {document.forms.monitor.txtM.value=separated_values[0].substring(8)} if(the_info=="username") {document.forms.monitor.txtM.value=separated_values[1].substring(9)} if(the_info=="VisitCount") {document.forms.monitor.txtM.value=separated_values[2].substring(11)} |
| Layout (function SetCookie(name,value,expiredays) ) Top |