0

ローカルのwamp servrに正常にロードされているゲーム(html5、createJS、Canvasを使用)を開発していますが、以下のようにWebサーバーでエラーが発生します。

Uncaught Error: NotSupportedError: DOM Exception 9 prototype.js:1263
document._getElementsByXPath prototype.js:1263
document.getElementsByClassName prototype.js:1272
a jquery-1.9.0.min.js:2
st.fn.extend.find jquery-1.9.0.min.js:2
st.fn.st.init jquery-1.9.0.min.js:1
st jquery-1.9.0.min.js:1
(anonymous function) index.php:95
f jquery-1.9.0.min.js:1
p.fireWith jquery-1.9.0.min.js:1
st.extend.ready jquery-1.9.0.min.js:1

原因は何ですか?

さらに表示

4

1 に答える 1

0

私は同じ問題を抱えていて、デスクトップのSafariとChromeでコードが正常に機能している間に、iosのcordovaアプリから「NotSupportedError:DOM Exception 9」を取得していました。element.children[0].children[0]&を使用して SVG 要素にアクセスしていましたelement.children[0].children[1]。要素はdiv;を含むものでした。children[0]だったsvg; およびchildren[0]& children[1]rectおよびtext、それぞれ。

DOM は正しく構築されているように見えました。

一部の環境では、私の場合はモバイル Safari で、SVG は XML としてのみ扱われるため、次の方法でアクセスする必要があることが判明しました。

element.getElementsByTagName('rect')[0];
element.getElementsByTagName('text')[0];

その後はすべて順調でした。

于 2014-10-24T13:11:48.367 に答える