Click to See Complete Forum and Search --> : Prototype.js - destination is undefined


Debbie-Leigh
August 16th, 2009, 07:29 PM
Hi,

I'm trying to use a javascript tabstrip script called aptabs, which uses prototype.js. However, prototype.js won't load properly, because the following error occurs in prototype.js:

destination is undefined

on the following line (3042):

destination[property] = value.methodize();

The function this line is in is:

function copy(methods, destination, onlyIfAbsent) {
onlyIfAbsent = onlyIfAbsent || false;
for (var property in methods) {
var value = methods[property];
if (!Object.isFunction(value)) continue;
if (!onlyIfAbsent || !(property in destination))
destination[property] = value.methodize();
}
}


I've tried using versions 1.6.0 all the way up to 1.6.1, but I still get the same error.

Can someone suggest what this error could be caused by and possible fixes?

Debbie

PeejAvery
August 16th, 2009, 09:38 PM
According to this, it would seem that you aren't passing the correct parameters. However...

Prototype is a rather large library. I would suggest contacting them first because they would know best. You also might want to include your code that references prototype's copy() method.

Debbie-Leigh
August 17th, 2009, 04:01 AM
Hi PeejAvery,

Unfortunately, it's not my code that's calling it. Prototype.js came with aptabs and I just followed the instructions to add it into the appropriate folders and my code.

I picked aptabs up from javascriptkit.com and I can't find any support link for it there or for prototype.js from any searches I've done for it.

Any idea who does prototype.js?

Debbie

PeejAvery
August 17th, 2009, 08:11 AM
Since apTabs works from javascriptkit.com, why don't you try using their prototype.js (http://www.javascriptkit.com/script/script2/apTabs/lib/prototype.js) page which is version 1.6.0.2. Also, you could just grab their JS source file as well.

Debbie-Leigh
August 17th, 2009, 05:52 PM
Hi PeejAvery,

apTabs comes with version 1.6.0.2, but I've just tried it with the version at the end of your link, but still got the same error.

Oh dear, I've run out of ideas now.

PeejAvery
August 17th, 2009, 06:57 PM
I suggest, rather than downloading the source code, take the exact linked files that the example page uses.