开发者

use jquery to call gwt uibinder div element

i looking for a manual way of manipulate div element开发者_开发技巧 inside uibinder using jquery without using gwtQuery . is there any example?

the jquery will be inside app.html that has the gwt-entry-point.nocache.js file

<html>
<head>
   <script type="text/javascript" language="javascript" src="jquery-1.4.2.min.js"></script>
    <script type="text/javascript" language="javascript" src="testapp/testapp.nocache.js"></script>
</head>

<body>
  <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>


</body>


<script>

alert( $('.cssclass ul li a img').width() );   //return null ,mean fail

//if i do like below with settimer, success
setTimeout("alert( $('.cssclass ul li a img').width() ) ", 5000) ;  // success, with result 

//if i use jquery.ready() or jquery.load() to call the selector  , all fail



</script>


How about calling those methods at least from your onModuleLoad? Before that, you can't be sure if GWT finished creating the DOM structure.

PS: Have you looked at JSNI? You could then integrate your calls to jQuery methods more smoothly with your GWT code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜