Okay
  Public Ticket #1292506
Uncaught TypeError: Cannot read property 'is' of undefined On Ajax DOM
Closed

Comments

  • M. Najamudin Ridha started the conversation

    i use layerslider with ajax dom, if i load without ajax, it work, but if i use ajax request, and scroll down, many Uncaught TypeError on console like this :

    (sorry about my english)

    VM1320:1 Uncaught TypeError: Cannot read property 'loop' of undefined
        at Object.reset (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:125483)
        at Object.onComplete (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:125394)
        at Object.onComplete (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:18417)
        at Object.g._callback (greensock.js:20)
        at Object.g.render (greensock.js:21)
        at d.k.render (greensock.js:18)
        at Object.g.render (greensock.js:20)
        at Object.C._updateRoot.F.render (greensock.js:21)
        at Object.g.dispatchEvent (greensock.js:20)
        at r (greensock.js:20)
    reset @ VM1320:1
    onComplete @ VM1320:1
    onComplete @ VM1320:1
    g._callback @ greensock.js:20
    g.render @ greensock.js:21
    k.render @ greensock.js:18
    g.render @ greensock.js:20
    C._updateRoot.F.render @ greensock.js:21
    g.dispatchEvent @ greensock.js:20
    r @ greensock.js:20
    VM1320:1 Uncaught TypeError: Cannot read property 'loop' of undefined
        at Object.reset (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:125483)
        at Object.onComplete (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:125394)
        at Object.onComplete (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:18417)
        at Object.g._callback (greensock.js:20)
        at Object.g.render (greensock.js:21)
        at d.k.render (greensock.js:18)
        at Object.g.render (greensock.js:20)
        at Object.C._updateRoot.F.render (greensock.js:21)
        at Object.g.dispatchEvent (greensock.js:20)
        at r (greensock.js:20)
    reset @ VM1320:1
    onComplete @ VM1320:1
    onComplete @ VM1320:1
    g._callback @ greensock.js:20
    g.render @ greensock.js:21
    k.render @ greensock.js:18
    g.render @ greensock.js:20
    C._updateRoot.F.render @ greensock.js:21
    g.dispatchEvent @ greensock.js:20
    r @ greensock.js:20
    VM1320:1 Uncaught TypeError: Cannot read property 'elements' of undefined
        at Object.addLayers (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:132073)
        at Object.create (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:127116)
        at Object.prepare (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:130864)
        at Object.eval (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:107302)
        at Object.g._callback (greensock.js:20)
        at Object.g.render (greensock.js:21)
        at d.k.render (greensock.js:18)
        at Object.g.render (greensock.js:20)
        at Object.C._updateRoot.F.render (greensock.js:21)
        at Object.g.dispatchEvent (greensock.js:20)
    addLayers @ VM1320:1
    create @ VM1320:1
    prepare @ VM1320:1
    (anonymous) @ VM1320:1
    g._callback @ greensock.js:20
    g.render @ greensock.js:21
    k.render @ greensock.js:18
    g.render @ greensock.js:20
    C._updateRoot.F.render @ greensock.js:21
    g.dispatchEvent @ greensock.js:20
    r @ greensock.js:20
    VM1320:1 Uncaught TypeError: Cannot read property 'hover' of undefined
        at Object.onStart (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:123973)
        at Object.onStart (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:17362)
        at Object.g._callback (greensock.js:20)
        at Object.g.render (greensock.js:21)
        at O.lazyRender (greensock.js:21)
        at d.k.render (greensock.js:18)
        at Object.g.render (greensock.js:20)
        at Object.C._updateRoot.F.render (greensock.js:21)
        at Object.g.dispatchEvent (greensock.js:20)
        at r (greensock.js:20)
    onStart @ VM1320:1
    onStart @ VM1320:1
    g._callback @ greensock.js:20
    g.render @ greensock.js:21
    O.lazyRender @ greensock.js:21
    k.render @ greensock.js:18
    g.render @ greensock.js:20
    C._updateRoot.F.render @ greensock.js:21
    g.dispatchEvent @ greensock.js:20
    r @ greensock.js:20
    VM1320:1 Uncaught TypeError: Cannot read property 'hover' of undefined
        at Object.onStart (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:123973)
        at Object.onStart (eval at <anonymous> (layerslider.kreaturamedia.jquery.js:13), <anonymous>:1:17362)
        at Object.g._callback (greensock.js:20)
        at Object.g.render (greensock.js:21)
        at O.lazyRender (greensock.js:21)
        at Object.C._updateRoot.F.render (greensock.js:21)
        at Object.g.dispatchEvent (greensock.js:20)
        at r (greensock.js:20)
    onStart @ VM1320:1
    onStart @ VM1320:1
    g._callback @ greensock.js:20
    g.render @ greensock.js:21
    O.lazyRender @ greensock.js:21
    C._updateRoot.F.render @ greensock.js:21
    g.dispatchEvent @ greensock.js:20
    r @ greensock.js:20


  • [deleted] replied

    Hey M. Najamudin Ridha,

    Unfortunately we cannot troubleshoot the problem from these errors only. Please show us your site or a test page where we can check on this to investigate.

  •   M. Najamudin Ridha replied privately
  • [deleted] replied

    The problem is related to the AJAX navigation that you are using. The error occurs when the AJAX navigation swaps the page content, removes the slider, but it does not stop it first so the plugin's scripts are still running in the background.

    I'd recommend to disable the AJAX navigation to solve this. It will most likely generate more issues in a lot of cases in the future, and it's not necessarly better or faster either. 

    Or if you want to stick with it, you would need to edit the JavaScript code that implements the AJAX navigation. You will need to change it in a way, where it calls the destroy API command on the slider using the LayerSlider API when it detects one in the page.

  • M. Najamudin Ridha replied

    Hi Attila, thanks for replay again, you are right, i add layerslider API to remove or distroy when ajax before send and now its work perfectly.... thanks very much..

  •   M. Najamudin Ridha replied privately
  • [deleted] replied

    Sure thing, you can use the demo sliders freely on your sites.