{"id":1759,"date":"2014-10-14T04:23:34","date_gmt":"2014-10-14T08:23:34","guid":{"rendered":"http:\/\/qxf2.com\/blog\/?p=1759"},"modified":"2014-10-14T04:24:22","modified_gmt":"2014-10-14T08:24:22","slug":"jasmine-jquery-error","status":"publish","type":"post","link":"https:\/\/qxf2.com\/blog\/jasmine-jquery-error\/","title":{"rendered":"Jasmine-Jquery error: object doesn&#8217;t support this property or method"},"content":{"rendered":"<p>I hit an error while using Jasmine and Jasmine-Jquery on a Windows 7 machine. Turned out that the root cause of the issue was with a Chrome setting on Windows 7. I spent significant amount of time googling before I found the solution. What tripped me in my Google search was that I kept searching for Jasmine\/Jasmine-JQuery errors. This mini-post is to help folk who hit the exact same issue as I did.<\/p>\n<p>I was trying to run <span style=\"text-decoration: underline;\">fixture.HTML<\/span> while using Jasmine-Jquery with the loadFixture() method. I was greeted with this strange error message:<\/p>\n<div style=\"background-color: #ffff99;\">\nTypeError: Object doesn&#8217;t support this property or method<br \/>\nError: Fixture could not be loaded: spec\/javascripts\/fixtures\/fixture.html\n<\/div>\n<p>This issue had nothing to do with Jasmine-Jquery. It was related with the cross domain policy settings under Chrome. Latest versions of Chrome don&#8217;t allow file:\/\/URIs to read other file:\/\/URIs for security reasons. <\/p>\n<p>One way to solve this problem is to run chrome.exe with the switch <code>--allow-file-access-from-files<\/code>. To do so, launch the command prompt and issue the following command:<br \/>\n<code> $CHROME_DIR\\chrome.exe --allow-file-access-from-files<\/code><br \/>\nOn my machine, the above command translated to:<br \/>\n<code>C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe --allow-file-access-from-files<\/code> .<\/p>\n<p><strong>Cautionary note:<\/strong> <strong><u>Do NOT <\/u><\/strong> surf the web with the &#8211;allow-file-access-from-files setting enabled &#8211; it is dangerous! There is a good security reason for why Chrome does not allow local files to access other local files. <\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>I hit an error while using Jasmine and Jasmine-Jquery on a Windows 7 machine. Turned out that the root cause of the issue was with a Chrome setting on Windows 7. I spent significant amount of time googling before I found the solution. What tripped me in my Google search was that I kept searching for Jasmine\/Jasmine-JQuery errors. This mini-post [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1759","post","type-post","status-publish","format-standard","hentry","category-how-to"],"_links":{"self":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/1759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/comments?post=1759"}],"version-history":[{"count":27,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/1759\/revisions"}],"predecessor-version":[{"id":1883,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/1759\/revisions\/1883"}],"wp:attachment":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/media?parent=1759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/categories?post=1759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/tags?post=1759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}