Giter Club home page Giter Club logo

Comments (2)

Radvansk avatar Radvansk commented on August 11, 2024 1

I ran into the same problem and my solution is below. Hope this helps.

  • https://github.com/xsanisty/calx.js/blob/main/jquery-calx-2.2.8.js

  • Line 37 has an issue: if (typeof Array.indexOf !== "function") {

  • The left side of the argument returns undefined. At least it returns undefined at the point where the file was loaded in my pages. Executing this typeof Array.indexOf from the dev tools browser console does return "function" so my assumption is the file was loading before the brower's native indexOf function was there. The plugin is setting the prototype.indexOf for browsers that do not need it which causes the error in gtag.js

  • Change Line 37 to if (!Array.prototype.indexOf) {

  • All done. Now the plugin only sets prototype.indexOf for browsers that actually need it. Which aren't very many and old ones like IE8 that nobody should be concerned about. I'm pretty sure gtag.js won't work in browsers that would access the code in this if block anyway.

from calx.js.

martindefatte avatar martindefatte commented on August 11, 2024 1

Thank you so much! This did the trick. I actually did it on the v1.x version of the plugin as well - been using this before 2.0 came along and I haven't converted the particular site over. MUCH APPRECIATED

from calx.js.

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.