2

私はこのようなd3javascriptを含めます

<!doctype html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
     <script src="http://d3js.org/d3.v2.js"></script>
     <script type="text/javascript" src="d3/d3.nocache.js"></script>

  </head>
  <body>
  </body>
</html>

次に、エントリポイントから呼び出すとd3がnullになるのはなぜですか?

package com.example.client;

import com.google.gwt.core.client.EntryPoint;


public class D3 implements EntryPoint {

    public void onModuleLoad() {
        test();
    }
    private native void test()/*-{
        $wnd.alert($wnd.d3); 
     }-*/;

}
4

1 に答える 1

0

さて、問題は私がプロジェクトにD3という名前を付けたことだったようです。javascriptライブラリのD3を上書きしているように見えるので、別の名前を付ける必要があります。

于 2012-07-29T20:42:48.633 に答える