ソースを参照

fix oembed for non-successful requests.

Lucas Stadler 11 年 前
コミット
658acc23cb
共有1 個のファイルを変更した1 個の追加2 個の削除を含む
  1. 1 2
      js/babl/public/index.html

+ 1 - 2
js/babl/public/index.html

@ -45,8 +45,7 @@
45 45
				var xhr = new XMLHttpRequest();
46 46
				xhr.open('GET', oembedEndpoint + '?format=json&maxwidth=450&url=' + url);
47 47
				xhr.onreadystatechange = function() {
48
					if (xhr.readyState == XMLHttpRequest.DONE) {
49
						console.log(url, xhr.status);
48
					if (xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {
50 49
						var tmpEl = document.createElement('div');
51 50
						tmpEl.innerHTML = JSON.parse(xhr.responseText).html;
52 51
						el.parentElement.replaceChild(tmpEl.firstChild, el);