J
Josselin
(Mac 10.4.6 , Firefox/1.5.0.3 Mozilla/5.0 (Macintosh; U; PPC Mac OS X
Mach-O; fr; rv:1.8.0.3) Gecko/20060426 )
I am trying to setup a Reusable Image Cache in JS ( as per
http://www.devx.com/webdev/Article/20947 )
In order to o survey the events from image loading in a group
container, It seems necessary to perform the following function,
ImagePair(file) .
Unfortunatly Firefox javascript checking mentions an error with this
function :
=> document.appendChild(this.image);
does anyone have a hint about it ?
------ JS function --------------
function ImagePair( _file ) {
// The ImagePair object's purpose is to keep track of the image and
the file that identifies it;
// we do this because the image's src attribute will read back as
uuencoded if interrogated, // meaning that, to see if a particular
image exists in the cache, we need to uuencode
// again. It seems easier just to store the path in unencoded form,
along with the image //associated with it.
this.file = _file;
this.image = new Image();
// Add the image to the document; if you don't, readystatechange
// events won't know where they originated, meaning that
event.srcElement will be null
document.appendChild(this.image);
}
----------- error message
Erreur : uncaught exception: [Exception... "Node cannot be inserted at
the specified point in the hierarchy" code: "3" nsresult: "0x80530003
(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location:
"http://www.ecolabs.loc/scripts_js/load-image.js Line: 82"]
Mach-O; fr; rv:1.8.0.3) Gecko/20060426 )
I am trying to setup a Reusable Image Cache in JS ( as per
http://www.devx.com/webdev/Article/20947 )
In order to o survey the events from image loading in a group
container, It seems necessary to perform the following function,
ImagePair(file) .
Unfortunatly Firefox javascript checking mentions an error with this
function :
=> document.appendChild(this.image);
does anyone have a hint about it ?
------ JS function --------------
function ImagePair( _file ) {
// The ImagePair object's purpose is to keep track of the image and
the file that identifies it;
// we do this because the image's src attribute will read back as
uuencoded if interrogated, // meaning that, to see if a particular
image exists in the cache, we need to uuencode
// again. It seems easier just to store the path in unencoded form,
along with the image //associated with it.
this.file = _file;
this.image = new Image();
// Add the image to the document; if you don't, readystatechange
// events won't know where they originated, meaning that
event.srcElement will be null
document.appendChild(this.image);
}
----------- error message
Erreur : uncaught exception: [Exception... "Node cannot be inserted at
the specified point in the hierarchy" code: "3" nsresult: "0x80530003
(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location:
"http://www.ecolabs.loc/scripts_js/load-image.js Line: 82"]