I'm trying to learn javascript from w3schools's website. I don't understand the code in red below. Is the code correct (are those 2 lines suppose to be 1 statement, the 1st semi colon should not be there)?
Thanks in advance.
Thanks in advance.
Code:
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
[COLOR=#EF2929]var c_value=escape(value) + ((exdays==null) ? "" : "[COLOR=#204A87];[/color]
expires="+exdate.toUTCString());[/color]
document.cookie=c_name + "=" + c_value;
}
setCookie("username",username,365);