From: Dave K. <dko...@ve...> - 2005-04-29 17:19:40
|
Ok, after more complete investigation, I must retract my statement that there is a problem with when the onload() function is being invoked in HTMLUnit. However, I think I have found another problem that was actually making it look as though onload was the problem. It appears that the problem lies with WebClient. In my java program, I set up a BrowserVersion to emulate Firefox: BrowserVersion bv; ... bv = new BrowserVersion("Netscape", "5.0 (Windows; en-US)", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3", "1.2"); ... WebClient webClient = new WebClient(bv,); In the javascript brought into the page, I added an alert to tell me what it thought the browser version is (in the full code, this is critical, since it takes different actions based on the type of browser): function DetectBrowser() { alert(navigator.appName); alert(navigator.appVersion); alert(navigator.userAgent); alert(navigator.appCodeName); alert(navigator.platorm); ... } And I get the following when I run the program: WARNING: window.alert("Microsoft Internet Explorer") no handler installed WARNING: window.alert("4.0 (compatible; MSIE 6.0b; Windows98)") no handler installed WARNING: window.alert("Mozilla/4.0 (compatible; MSIE 6.0b; Windows98)") no handler installed WARNING: window.alert("Mozilla") no handler installed WARNING: window.alert("Win32") no handler installed So either I am doing something very wrong, or my BrowserVersion is being completely ignored. I also tried using the various pre-defined BrowserVersion values in the BrowserVersion class, all with the same result. Thanks, Dave |