{"id":1393,"date":"2022-08-30T15:16:09","date_gmt":"2022-08-30T15:16:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/15\/jquery-popover-wont-load-second-time-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:09","modified_gmt":"2022-08-30T15:16:09","slug":"jquery-popover-wont-load-second-time-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jquery-popover-wont-load-second-time-collection-of-common-programming-errors\/","title":{"rendered":"jQuery popover wont load second time-Collection of common programming errors"},"content":{"rendered":"<p>I am using this popover on my page: https:\/\/github.com\/klaas4\/jQuery.popover I have multiple instances of the popover with different content and triggers. This is my JavaScript that says what should happen when i press a link<\/p>\n<pre><code>$(\".addWorker\").popover({\n    title: \"Worker\",\n    content: \"Laddar...\"\n});\n\n$(\".addWorker\").click(function (event) {\n    event.preventDefault();\n    $(this).popover(\n        'ajax',\n        \"\/jobs\/AddWorker?jobid=\" + $(this).attr(\"id\")\n    ).popover('show');\n});\n\n$(\".markAsFinished\").popover({\n    title: \"Finished\",\n    content: \"Laddar...\"\n});\n\n$(\".markAsFinished\").click(function (e) {\n    e.preventDefault();\n    $(this).popover(\n<\/code><\/pre>\n<p>Uncaught TypeError: Object [object Object] has no method &#8216;popover&#8217; (repeated 3 times) &#8216;ajax&#8217;, &#8220;\/jobs\/MarkAsFinished?jobid=&#8221; + $(this).parent().parent().attr(&#8220;data-jobid&#8221;) + &#8220;&amp;userid=&#8221; + $(this).parent().parent().attr(&#8220;data-userid&#8221;) ).popover(&#8216;show&#8217;); });<\/p>\n<p>Now this works great the first time i click a link, and the popover shows up. The content is loaded and presentet within the popover. But then when i want to open up another popover (presses another link), it get&#8217;s stuck at &#8220;loading&#8221; and no content is loaded. The same link works great if i refresh the page. Chrome Developer Tools tells me the following:<\/p>\n<pre><code>Uncaught TypeError: Object [object Object] has no method 'popover' \n<\/code><\/pre>\n<p>I have no idea how to solve this, so any help is appreciated.<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-15 09:08:37. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am using this popover on my page: https:\/\/github.com\/klaas4\/jQuery.popover I have multiple instances of the popover with different content and triggers. This is my JavaScript that says what should happen when i press a link $(&#8220;.addWorker&#8221;).popover({ title: &#8220;Worker&#8221;, content: &#8220;Laddar&#8230;&#8221; }); $(&#8220;.addWorker&#8221;).click(function (event) { event.preventDefault(); $(this).popover( &#8216;ajax&#8217;, &#8220;\/jobs\/AddWorker?jobid=&#8221; + $(this).attr(&#8220;id&#8221;) ).popover(&#8216;show&#8217;); }); $(&#8220;.markAsFinished&#8221;).popover({ title: &#8220;Finished&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1393","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1393"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1393\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}