开发者

uibinder element get with jquery selector fail on chrome/safari

i have uibinder html element like below

       <g:HTMLPanel>
  <div class='thumbnailWrapper'>
     <ul>
         <li>
             <a href='#'><img src='41546-140.jpg' /></a>
             <div class='caption'>
                 <p class='captionInside'>testing javascript</p>
             </div>
         </li>
         <div class='clear'></div><!-- clear the float -->
     </ul><!-- end unordered list -->
</div><!-- end spolightWrapper div -->

<script>
jQ_Zoom();
</script>

        </g:HTMLPanel>

my javascript have no problem executed in firefox,ie. but in safari/ chrome, the开发者_Go百科 javascript is not call. have a look at my uploaded sample at http://bit.ly/ayuFc1 . try open with firefox and compared with chrome/safari

my javascript

function jQ_Zoom(){

      alert('yoyo');    

alert($('.thumbnailWrapper ul li').find('img').height());

}


It looks like you are putting the <script> tag directly in your UiBinder xml, that doesn't look right. I think the correct solution is either:

  1. Wrap the Javascript function in a JSNI call.
  2. Make your Javascript <script> call in your HTML file (outside of the UiBinder).

The first option is the preferred method of integrating native Javascript with GWT.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜