{"id":966,"date":"2013-08-21T12:38:14","date_gmt":"2013-08-21T20:38:14","guid":{"rendered":"http:\/\/blog.portnumber53.com\/?p=966"},"modified":"2013-08-21T12:38:14","modified_gmt":"2013-08-21T20:38:14","slug":"javascript-chrome-is-a-lot-more-restrict","status":"publish","type":"post","link":"https:\/\/blog.portnumber53.com\/index.php\/2013\/08\/21\/javascript-chrome-is-a-lot-more-restrict\/","title":{"rendered":"Javascript: Chrome is a lot more restrict"},"content":{"rendered":"<p>Today I ran into an issue where simple javascript would stop running for no apparent reason.<\/p>\n<p>I finally traced the problem down to where I was handling the response on a jquery.form callback:<\/p>\n<p>&nbsp;<\/p>\n<pre>                            if (response.message instanceof Array) {\n                                var html = &quot;&quot;;\n                                for (<strong>var <\/strong>line in response.message) {\n                                    html += &quot;&lt;li&gt;&quot; + line + &quot;&lt;\/li&gt;&quot;;\n                                }\n                            } else {\n                                html = response.message;\n                            }\n                            $(&quot;#errorMessages ul&quot;).html(html);<\/pre>\n<p>&nbsp;<\/p>\n<p>Since I was missing &quot;var&quot; in the for loop for response.message, chrome would thrown an error, and no more code would run on the iframe&#8230;<\/p>\n<p>Noting that it was working yesterday, that drove me nuts for a while.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I ran into an issue where simple javascript would stop running for no apparent reason. I finally traced the problem down to where I was handling the response on a jquery.form callback: &nbsp; if (response.message instanceof Array) { var html = &quot;&quot;; for (var line in response.message) { html&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/blog.portnumber53.com\/index.php\/2013\/08\/21\/javascript-chrome-is-a-lot-more-restrict\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-966","post","type-post","status-publish","format-standard","hentry","category-development"],"_links":{"self":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/comments?post=966"}],"version-history":[{"count":0,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/966\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/media?parent=966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/categories?post=966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/tags?post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}