GWT,RootPanel.get()为null
我正在学习一门初级教程。 HelloWorld.html文件的代码为:GWT,RootPanel.get()为null,gwt,Gwt,我正在学习一门初级教程。 HelloWorld.html文件的代码为: <html> <head> <title>Hello World</title> <link rel="stylesheet" href="HelloWorld.css"/> <script language="javascript" src="helloworld/helloworld.nocache.js"> </script
<html>
<head>
<title>Hello World</title>
<link rel="stylesheet" href="HelloWorld.css"/>
<script language="javascript" src="helloworld/helloworld.nocache.js">
</script>
</head>
<body>
<div id="mytext"><h1>Hello, World!</h1></div>
<div id="gwtGreenButton"></div>
<div id="gwtRedButton"></div>
</body>
</html>
两行:RootPanel.get()总是导致null。我不知道发生了什么,要检查什么?(可惜网站没有评论/讨论区)
谢谢。医生说
获取与给定浏览器元素关联的根面板
获取与整个文档中给定唯一id关联的元素
试一试
com.google.gwt.user.client.DOM.getElementById("gwtGreenButton");
com.google.gwt.user.client.DOM.getElementById("gwtRedButton");
所有浏览器都会出现这种情况吗?在devmode还是prod模式下?(或者两者都有?)你没有仔细检查身份证是否完全相同吗?想知道在
之前移动
是否会改变任何东西。
com.google.gwt.user.client.DOM.getElementById("gwtGreenButton");
com.google.gwt.user.client.DOM.getElementById("gwtRedButton");