fixing js exception thrown when cookie deleted from cookie viewer.

This commit is contained in:
rgoodger%ihug.co.nz 1999-12-22 04:03:57 +00:00
parent 340c181524
commit 30f7e05a71

View File

@ -95,14 +95,14 @@ function CreateCookieList()
// purpose : an home-brewed object that represents a individual cookie in the stream
function Cookie(number,name,value,domaintype,domain,path,secure,expire)
{
this.number = ( number ) ? number : null;
this.name = ( name ) ? name : null;
this.value = ( value ) ? value : null;
this.domaintype = ( domaintype ) ? domaintype : null;
this.domain = ( domain ) ? domain : null;
this.path = ( path ) ? path : null;
this.secure = ( secure ) ? secure : null;
this.expire = ( expire ) ? expire : null;
this.number = (arguments.length) ? number : null;
this.name = (arguments.length) ? name : null;
this.value = (arguments.length) ? value : null;
this.domaintype = (arguments.length) ? domaintype : null;
this.domain = (arguments.length) ? domain : null;
this.path = (arguments.length) ? path : null;
this.secure = (arguments.length) ? secure : null;
this.expire = (arguments.length) ? expire : null;
}
@ -138,12 +138,12 @@ function ViewCookieSelected( e )
if( cookietree.selectedItems.length )
document.getElementById("removeCookies").removeAttribute("disabled","true");
if( e.type == "keypress" || e.type == "select" )
if( ( e.type == "keypress" || e.type == "select" ) && e.target.selectedItems.length )
cookie = cookietree.selectedItems[0];
if( e.type == "click" )
cookie = e.target.parentNode.parentNode;
if(cookie.getAttribute("id").indexOf("tree_") == -1)
if( !cookie || cookie.getAttribute("id").indexOf("tree_") == -1)
return false;
var idx = parseInt(cookie.getAttribute("id").substring(5,cookie.getAttribute("id").length));
for (x=0; x<cookies.length; x++) {