Minimal prototype

A

andersnordbo

Hello

I'm currently working on a project where i needed a slider. Some weeks
back it was decided to go for the script.aculo.us slider, as that
required little effort to implement into the project. However at this
point I need to shrink down the prototype.js framework (that this
slider is based on), because only some of the code is used by my
project (the parts required by slider.js) and it's important that the
total download size is as small as possible to ensure overall user
satisfaction for this project. So I started copying objects, and the
functions and variables that came with them, but only those that were
demanded from the slider or from any call that the slider had. The
original prototype.js is about 54K, and my stripped down minimal slider
version of prototype.js is just 10K! So far so good. Then I opened the
page containing the slider, and the JS console gave me a lot of errors.
So I started working my way through them, adding functions I had
forgotten to include in my new prototype.js as I went along. Now here's
the problem:

Opera says:
Type mismatch (usually a non-object value used where an object is
required)

FF says:
this.include is not a function

The function where it stops is an object function, and here it is ...

remove: function(classNameToRemove) {
if (!this.include(classNameToRemove)) return;
this.set(this.select(function(className) {
return className != classNameToRemove;
}).join(' '));
}

Naturally I have tried to check the parameter values, and alert(this +
" " + classNameToRemove); told me that "this" is in fact an object. If
you know a lot about prototype and or the scriptaculous slider, or are
familiar with this kind of problem I'd be very grateful for your help!
You probably need to see more code to be able to help me in any way.
Unfortunately I can't attach any files to this post, so to see the
files please go to the link at the bottom of this post to access the
minimal version of prototype.js (included in slider1.html) and the
unmodified prototype.js (shown in slider2.html) for comparison. In
case you should ask I'm using my home server because the company I'm
working for does not wish to reveal it's identity.

http://anders.gotdns.org:1234/prototype/

Thanks in advance,
DisconnectedMajor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top