Menu icon Foundation
Console errors related to tooltip

Hi, I 'm using foundation 5 on our website kondom.eu. I don't know if my issue is a bug, anyway, if use a tooltip by adding it in the template file, I get some js errors in the browser console.

 

These errors are similar to this:

Uncaught TypeError: elem.getAttribute is not a function at Function.Sizzle.attr (jquery.js:1708)

at Array.<anonymous> (jquery.js:1901)

at jquery.js:2396 at superMatcher (jquery.js:2603)

at select (jquery.js:2765)

at Function.Sizzle [as find] (jquery.js:1154)

at HTMLDocument.handlers (jquery.js:4722)

at HTMLDocument.dispatch (jquery.js:4659)

at HTMLDocument.elemData.handle (jquery.js:4361)

at init.empty (jquery.js:5520)

 

 

I think it is due to loading of some stuff by ajax requests. Instead, when I add tooltip html code by ajax and then I initialize foundation, there is no error in console.

Can you tell me how can I debug this issue?

For now, our website is visible to developers. So I can show you it if you provide me your ip address Thanks 

tooltipFoundationAJAX

Hi, I 'm using foundation 5 on our website kondom.eu. I don't know if my issue is a bug, anyway, if use a tooltip by adding it in the template file, I get some js errors in the browser console.

 

These errors are similar to this:

Uncaught TypeError: elem.getAttribute is not a function at Function.Sizzle.attr (jquery.js:1708)

at Array.<anonymous> (jquery.js:1901)

at jquery.js:2396 at superMatcher (jquery.js:2603)

at select (jquery.js:2765)

at Function.Sizzle [as find] (jquery.js:1154)

at HTMLDocument.handlers (jquery.js:4722)

at HTMLDocument.dispatch (jquery.js:4659)

at HTMLDocument.elemData.handle (jquery.js:4361)

at init.empty (jquery.js:5520)

 

 

I think it is due to loading of some stuff by ajax requests. Instead, when I add tooltip html code by ajax and then I initialize foundation, there is no error in console.

Can you tell me how can I debug this issue?

For now, our website is visible to developers. So I can show you it if you provide me your ip address Thanks 

Rafi Benkual about 2 years ago

Yes likely the AJAX request

If you add new content after the page has been loaded, you will need to reinitialize the Foundation JavaScript by running the following:

$(document).foundation();

Reflow will make Foundation check the DOM for any elements and re-apply any listeners to them.

$(document).foundation('tooltip', 'reflow');