si può inserire del codice java su altervista ?
vorrei sapere se si può inserire del codice java su altervista
vorrei anche sapere cosa significano queste righe di codice java e come le devo adttere alle mie esigenze:
1
// alert( readCookie("myCookie") ); function readCookie(name) { var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; }
2
// writeCookie("myCookie", "my name", 24); // Stores the string "my name" in the cookie "myCookie" which expires after 24 hours. function writeCookie(name, value, hours) { var expire = ""; if(hours != null) { expire = new Date((new Date()).getTime() + hours * 3600000); expire = "; expires=" + expire.toGMTString(); } document.cookie = name + "=" + escape(value) + expire; }
3
function messageWindow(title, msg) { var width="300", height="125"; var left = (screen.width/2) - width/2; var top = (screen.height/2) - height/2; var styleStr = 'toolbar=no,location=no,directories=no,status=no,m enubar=no,scrollbar=no,resizable=no,copyhistory=ye s,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top; var msgWindow = window.open("","msgWindow", styleStr); var head = '
4
function redirect(URLStr) { location = URLStr; }