I have the tooltip for bootstrap working, but anytime I try and initiate the popover instead I get the error Uncaught TypeError: Cannot read property 'prototype' of undefined or Uncaught TypeError: Cannot read property 'Constructor' of undefined with the following code
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
constructor: Popover
, setContent: function () {
var $tip = this.tip()
, title = this.getTitle()
, content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.removeClass('fade top bottom left right in')
}
I am unclear of the hiccup, because I did see it working previously. Any ideas? Thanks in advance.
I have the tooltip for bootstrap working, but anytime I try and initiate the popover instead I get the error Uncaught TypeError: Cannot read property 'prototype' of undefined or Uncaught TypeError: Cannot read property 'Constructor' of undefined with the following code
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
constructor: Popover
, setContent: function () {
var $tip = this.tip()
, title = this.getTitle()
, content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.removeClass('fade top bottom left right in')
}
I am unclear of the hiccup, because I did see it working previously. Any ideas? Thanks in advance.
Share Improve this question asked Sep 3, 2013 at 18:45 triplethreat77triplethreat77 1,2968 gold badges35 silver badges70 bronze badges 6- Could you create a jsfiddle? – Jonathan Crowe Commented Sep 3, 2013 at 18:46
- Unfortunately, the widget js for bootstrap is not hosted. I tried to start it at least. jsfiddle/ZrL2q/3 – triplethreat77 Commented Sep 3, 2013 at 18:57
- Have you seen this post about extending Object.prototype? [stackoverflow./questions/10955124/… – crazymatt Commented Sep 3, 2013 at 19:56
- @crazymatt so a previous js I'm using is breaking? I'm not doing anything out of the ordinary. – triplethreat77 Commented Sep 3, 2013 at 20:38
- Its hard to say without seeing what code you are using. I suggest re-downloading BootStrap and getting it to work without modifying any of the code. If it doesnt work then your configuration is not set up correctly. If it does work then its probably a conflicting issue with the code you are trying to integrate it with. – crazymatt Commented Sep 3, 2013 at 21:54
2 Answers
Reset to default 4I had this same issue and was able to fix it with the help of Paul Watson's ment
Make sure bootstrap-tooltip.js is included before bootstrap-popover.js
Try wrapping your call in a $(document).ready()
block
ie:
$(document).ready(function() {
$('.tipsPop').tooltip();
});