ng-joyride icon indicating copy to clipboard operation
ng-joyride copied to clipboard

Cannot read property 'ownerDocument' of undefined on Element types

Open scotteza opened this issue 8 years ago • 5 comments

This line of code: $fkEl.popover('show');

Throws the exception:

angular.js:11594 TypeError: Cannot read property 'ownerDocument' of undefined (full stack at the end of this comment).

With a breakpoint on $fkEl.popover('show');, I can see that the selector has found my element, but for some reason is throwing this exception. What am I doing wrong?

The stack trace is as follows:

angular.js:11594 TypeError: Cannot read property 'ownerDocument' of undefined at Function.gb.contains (http://localhost/bower_components/jquery/dist/jquery.min.js:2:12147) at Function.n.extend.buildFragment (http://localhost/bower_components/jquery/dist/jquery.min.js:3:14212) at n.fn.extend.domManip (http://localhost/bower_components/jquery/dist/jquery.min.js:3:16801) at n.fn.extend.after (http://localhost/bower_components/jquery/dist/jquery.min.js:3:15338) at n.each.n.fn.(anonymous function) as insertAfter at c.show (http://localhost/bower_components/bootstrap/dist/js/bootstrap.min.js:6:22544) at HTMLSpanElement. (http://localhost/bower_components/bootstrap/dist/js/bootstrap.min.js:6:27388) at Function.n.extend.each (http://localhost/bower_components/jquery/dist/jquery.min.js:2:2882) at n.fn.n.each (http://localhost/bower_components/jquery/dist/jquery.min.js:2:847) at b as popover

scotteza avatar Apr 17 '16 19:04 scotteza

I am also having this same issue - the element clearly gets selected, but in debugging the code it seems to call apart somewhere near

        function _showTooltip() {
            var self =this;
            $timeout(function () {
                $fkEl.popover('show');

compsagnathus avatar May 13 '16 19:05 compsagnathus

@compsagnathus, I realised that there is a bug in the downloadable code which is fixed in the demo page. I diff'd the code from the root project, and the code on this page: http://abhikmitra.github.io/ng-joyride-demo/#/ and found minor differences.

So, just replace the version you are using with the ng-joyride.js on the demo page and it will work!

scotteza avatar May 13 '16 21:05 scotteza

thanks so much!

compsagnathus avatar May 14 '16 01:05 compsagnathus

hello, can you explain the source of this bug please? I have the same bug and i have brought enormously modification to the original code, so I can't replace my code with the code in the demo page

Fr0ozen avatar May 27 '16 13:05 Fr0ozen

@Fr0ozen I don't know the exact details, I just know the demo version worked where the version on GitHub didn't.

To see the differences, diff the code between commit c599569 on this project and the code here: http://abhikmitra.github.io/ng-joyride-demo/bower_components/ng-joyride/ng-joyride.js using any diff tool (winmerge etc.).

You should then be able to merge these changes into your updated code.

scotteza avatar Jun 01 '16 17:06 scotteza