Minimal prototype

Discussion in 'Javascript' started by andersnordbo@gmail.com, Jul 28, 2006.

  1. Guest

    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
     
    , Jul 28, 2006
    #1
    1. Advertising

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
    Replies:
    5
    Views:
    806
  2. June Lee
    Replies:
    2
    Views:
    843
    Jim Cobban
    Apr 13, 2008
  3. Replies:
    9
    Views:
    230
    Thomas 'PointedEars' Lahn
    May 26, 2006
  4. Replies:
    3
    Views:
    287
  5. javascript fish
    Replies:
    0
    Views:
    194
    javascript fish
    Oct 11, 2008
Loading...

Share This Page