Javascript 如何通过ScriptInjector在GWT中使用JS库?
我想在GWT中使用javascript库 我将文件放在公用文件夹中,以便在客户端和服务器之间共享,并在本教程()之后注入javscript 每次我执行我的javscriptcode时,我都会得到一个“NotaFunction”异常Javascript 如何通过ScriptInjector在GWT中使用JS库?,javascript,gwt,Javascript,Gwt,我想在GWT中使用javascript库 我将文件放在公用文件夹中,以便在客户端和服务器之间共享,并在本教程()之后注入javscript 每次我执行我的javscriptcode时,我都会得到一个“NotaFunction”异常 public static native void drawScheduler() /*-{ var calendar = $doc.getElementById("calendar"); calendar.fullCalendar({
public static native void drawScheduler() /*-{
var calendar = $doc.getElementById("calendar");
calendar.fullCalendar({
defaultView: 'timelineMonth',
events: [
// events go here
],
resources: [
// resources go here
]
// other options go here...
});
}-*/;
假设
fullCalendar
来自jQuery插件,则DOM元素不会被修改;您需要将它包装在jQuery“对象”(通常是$(日历)
,这里可能是$win.$(日历)
)您使用的gwt版本是什么?
public static native void drawScheduler() /*-{
var calendar = $doc.getElementById("calendar");
calendar.fullCalendar({
defaultView: 'timelineMonth',
events: [
// events go here
],
resources: [
// resources go here
]
// other options go here...
});
}-*/;