WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Content Slide
[resolved] javascript object not found error (2 posts)

  1. nabramovitz
    Member
    Posted 3 years ago #

    Object does not support this property or method: prototype.js?ver=1.6.1 line 4821 character 5

    instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
    function(element, className) {
    className = className.toString().strip();
    var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
    return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
    } : function(element, className) {
    className = className.toString().strip();
    var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
    if (!classNames && !className) return elements;
    /* Error generated on the following statement from the $(element) */
    /* The element has the method but the return from $(element) is null */
    var nodes = $(element).getElementsByTagName('*');
    className = ' ' + className + ' ';

    for (var i = 0, child, cn; child = nodes[i]; i++) {
    if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
    (classNames && classNames.all(function(name) {
    return !name.toString().blank() && cn.include(' ' + name + ' ');
    }))))
    elements.push(Element.extend(child));
    }
    return elements;
    };

  2. nabramovitz
    Member
    Posted 3 years ago #

    There is a conflict between prototype.js and jquery.js on the $ function. I needed to modify prototype.js by copying its $ function to a new function named $$$ and then modify the offending function to use the $$$ instead of $.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic