{"id":6425,"date":"2014-04-18T05:21:26","date_gmt":"2014-04-18T05:21:26","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/uncaught-typeerror-undefined-is-not-a-function-bootstrap-min-js6-collection-of-common-programming-errors\/"},"modified":"2014-04-18T05:21:26","modified_gmt":"2014-04-18T05:21:26","slug":"uncaught-typeerror-undefined-is-not-a-function-bootstrap-min-js6-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/uncaught-typeerror-undefined-is-not-a-function-bootstrap-min-js6-collection-of-common-programming-errors\/","title":{"rendered":"Uncaught TypeError: undefined is not a function bootstrap.min.js:6-Collection of common programming errors"},"content":{"rendered":"<p>i made a function appendScript which will be called on a button click event my function code is<\/p>\n<pre><code>function appendScript()\n{\n    var v_js;\n    var head= document.getElementsByTagName('head')[0];\n    v_js = document.createElement('script');\n    v_js.type = 'text\/javascript';\n    v_js.src = \"\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/2.0.2\/jquery.min.js\";\n    head.appendChild(v_js);\n\n    var body = document.getElementsByTagName('body')[0];\n    v_js =document.createElement('script');\n    v_js.type=\"text\/javascript\" ;\n    v_js.src = \"\/\/cdnjs.cloudflare.com\/ajax\/libs\/twitter-bootstrap\/2.3.2\/js\/bootstrap.min.js\";\n\n    body.appendChild(v_js);\n    var v_css = document.createElement('link');\n\n    body.appendChild(v_css);\n\n    interval=self.setInterval(function(){  if(jQuery &amp;&amp; typeof $().modal ==  'function')\n        {\n\n            window.clearInterval(interval);\n\n            \/\/create a div in the body which we will use for our dialog.\n            $(document.getElementsByTagName('body')[0]).append('\u00d7<\/code><\/pre>\n<h3 id=\"myModalLabel\"><code>Modal header<\/code><\/h3>\n<pre><br \/>One fine body.CloseSave changes');\n\n            $('#myModal').modal('show')\n            \/\/setTimeout is non blocking (basically async) so lets put our apex call in a timeout so it doesn't\n            \/\/stop our dialog from showing.\n\n         }\n\n    }\n,300);                           \n\n}\n<\/pre>\n<p><code>and the error i am facing is<\/code><\/p>\n<pre><code><code>Uncaught TypeError: undefined is not a function bootstrap.min.js:6\n(anonymous function) bootstrap.min.js:6\n(anonymous function) bootstrap.min.js:6\n<\/code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>i made a function appendScript which will be called on a button click event my function code is function appendScript() { var v_js; var head= document.getElementsByTagName(&#8216;head&#8217;)[0]; v_js = document.createElement(&#8216;script&#8217;); v_js.type = &#8216;text\/javascript&#8217;; v_js.src = &#8220;\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/2.0.2\/jquery.min.js&#8221;; head.appendChild(v_js); var body = document.getElementsByTagName(&#8216;body&#8217;)[0]; v_js =document.createElement(&#8216;script&#8217;); v_js.type=&#8221;text\/javascript&#8221; ; v_js.src = &#8220;\/\/cdnjs.cloudflare.com\/ajax\/libs\/twitter-bootstrap\/2.3.2\/js\/bootstrap.min.js&#8221;; body.appendChild(v_js); var v_css = document.createElement(&#8216;link&#8217;); body.appendChild(v_css); interval=self.setInterval(function(){ if(jQuery [&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-6425","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6425","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=6425"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6425\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}