{"id":3111,"date":"2014-03-16T20:28:45","date_gmt":"2014-03-16T20:28:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/codemirror-htmlmixed-mode-breaks-collection-of-common-programming-errors\/"},"modified":"2014-03-16T20:28:45","modified_gmt":"2014-03-16T20:28:45","slug":"codemirror-htmlmixed-mode-breaks-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/codemirror-htmlmixed-mode-breaks-collection-of-common-programming-errors\/","title":{"rendered":"CodeMirror htmlmixed mode breaks-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m building a mobile web application with jQuery Mobile and CodeMirror. But since I&#8217;m trying to use htmlmixed mode, I&#8217;m having troubles. (With css mode or js mode it works perfectly)<\/p>\n<pre><code>TypeError: 'undefined' is not a function (evaluating 'htmlMode.startState()') in htmlmixed.js:72\n<\/code><\/pre>\n<p>Does anybody know how to debug this? I tried for hours. I commented out this line, I inspected the <code>htmlMode<\/code> object, searched with DuckDuckGo and Google&#8230; No luck.<\/p>\n<p>These are the lines with which I&#8217;m loading CodeMirror:<\/p>\n<pre><code>\n\n\n\n\n<\/code><\/pre>\n<p>And so I&#8217;m initializing CodeMirror:<\/p>\n<pre><code>$(document).on(\"pageinit\",\"#asite\",function (){\n    var mirror = CodeMirror.fromTextArea(document.getElementById(\"dateifeld\"),{\n        lineNumbers: true,\n        mode: \"text\/html\",\n        lineWrapping: true\n    });\n});\n<\/code><\/pre>\n<p>Here is the relevant HTML:<\/p>\n<pre><code>\n<\/code><\/pre>\n<p><strong>Edit:<\/strong> Got it! The problem was that I didn&#8217;t included the XML script. (CodeMirror HTML mode not working)<\/p>\n<pre><code>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m building a mobile web application with jQuery Mobile and CodeMirror. But since I&#8217;m trying to use htmlmixed mode, I&#8217;m having troubles. (With css mode or js mode it works perfectly) TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;htmlMode.startState()&#8217;) in htmlmixed.js:72 Does anybody know how to debug this? I tried for hours. I commented out [&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-3111","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3111","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=3111"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3111\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}