Coder Social home page Coder Social logo

Comments (7)

dk1 avatar dk1 commented on June 8, 2024

I had the same issue here - I changed the code to loop through the entries using a for loop and added them that way, seemed to fix it!

        _initialTags: function() {
            var input = this;
            if (this.options.initialTags.length != 0) {
                for (var i = 0; i < this.options.initialTags.length; i++) {
                    input._addTag(this.options.initialTags[i]);
                }
            }
        }

from jquery-tagit.

aarek avatar aarek commented on June 8, 2024

same using jquery each method:

_initialTags: function() {
    var input = this;
    if (this.options.initialTags.length != 0) {
        $(this.options.initialTags).each(function(i, element){
            input._addTag(element);
        });
    }
}

from jquery-tagit.

misja avatar misja commented on June 8, 2024

Iterating over initialTags doesn't work because the array object doesn't have an each call defined. The following solves the issue, though think _initialTags should use the regular way of iterating the array like @dk1 did.

Array.prototype.each = function(callback){
    for (var i =  0; i < this.length; i++){
        callback(this[i]);
    }
};

from jquery-tagit.

craigspaeth avatar craigspaeth commented on June 8, 2024

@dk1, Thanks I was having the same problem. You should make a pull request.

from jquery-tagit.

dk1 avatar dk1 commented on June 8, 2024

Looks like @aarek has already made a fork with a fix. @aarek - have you made a pull request?

from jquery-tagit.

aarek avatar aarek commented on June 8, 2024

yup

from jquery-tagit.

hailwood avatar hailwood commented on June 8, 2024

Thank you aarek, pull request merged :)

from jquery-tagit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.