From: Zbigniew K. <ch...@wp...> - 2005-07-07 14:07:24
|
I'have a little problem :) Part of my web page is written in JavaScript. There are implemented couple methods. One of those look as follows: function getWidth() { var width=window.innerWidth; if (width==null) width=document.body.offsetWidth; return w; } When I try to test that page using settings for Mozilla: final WebClient webClient = new WebClient(BrowserVersion.MOZILLA_1_0); everythigs worked ok, the property window.innerWidth returned proper value of window width, but problem arrived when I switched configuration to: final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); Now document.body.offsetWidth returns nothing. I tried to add another property in JavaScriptConfiguration.xml file: <property name="clientWidth" readable="true" writable="false"/> <property name="clientHeight" readable="true" writable="false"/> and I change offsetWidth to clientWidth in getWidth function, but this solution doesn't solve the problem. Is there some possibility to get size of the document (or window) in such a way, that hmtlunit works with it ok in both (Mozilla and IE) situations? Or maybe htmlunit can be configured in some other way? Best regards Zbyhoo ---------------------------------------------------- Zadbaj o bezpieczne wakacje nad wodą! Włącz się w Bezpieczne lato z NIVEA i WOPR http://klik.wp.pl/?adr=www.sport.wp.pl%2Fnivea-wopr.html&sid=427 |