Minimal prototype

Discussion in 'Javascript' started by, Jul 28, 2006.

  1. Guest


    I'm currently working on a project where i needed a slider. Some weeks
    back it was decided to go for the 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

    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( {
    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.

    Thanks in advance,
    , Jul 28, 2006
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Barrett
  2. June Lee
    Jim Cobban
    Apr 13, 2008
  3. Replies:
    Thomas 'PointedEars' Lahn
    May 26, 2006
  4. Replies:
  5. javascript fish
    javascript fish
    Oct 11, 2008

Share This Page