浏览代码

Mark xhr.status=0 as successful

Sergey Gospodarets 11 年之前
父节点
当前提交
75247a8860
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      plugin/markdown/markdown.js

+ 4 - 1
plugin/markdown/markdown.js

@@ -219,7 +219,10 @@
 
 				xhr.onreadystatechange = function() {
 					if( xhr.readyState === 4 ) {
-						if ( xhr.status >= 200 && xhr.status < 300 ) {
+						if (
+                            (xhr.status >= 200 && xhr.status < 300) ||
+                            xhr.status === 0 // file protocol yields status code 0 (useful for local debug, mobile applications etc.)
+                            ) {
 
 							section.outerHTML = slidify( xhr.responseText, {
 								separator: section.getAttribute( 'data-separator' ),