From: Anzinger, S. <SAn...@th...> - 2005-08-18 23:59:50
|
Hello! I've found a problem with handling links done with javascript: a.html: ------------------------------------------------------------- <html xmlns=3D"http://www.w3.org/1999/xhtml"> <head> <title>Page A</title> </head> <body> <a href=3D"#" onclick=3D"document.location.href=3D'b.html'" name=3D"link">link</a> </body> </html> ------------------------------------------------------------- b.html: ------------------------------------------------------------- <html xmlns=3D"http://www.w3.org/1999/xhtml"> <head> <title>Page B</title> </head> <body> <iframe src=3D"c.html"></iframe> </body> </html> ------------------------------------------------------------- c.html: ------------------------------------------------------------- <html xmlns=3D"http://www.w3.org/1999/xhtml"> <head> <title>Page C</title> </head> <body> test </body> </html> ------------------------------------------------------------- Testprogram: ------------------------------------------------------------- WebClient client =3D new WebClient(); HtmlPage p =3D (HtmlPage)client.getPage(new URL("http://.../a.html")); =20 HtmlAnchor b =3D p.getAnchorByName("link"); p =3D (HtmlPage)b.click(); System.out.println("We are on " + p.getTitleText()); ------------------------------------------------------------- HTMLUnit navigate to Page A. When the href attribute is empty (href=3D"") HTMLUnit will navigate to Page C. Mozilla and IE will navigate to Page B (with href=3D"#"). I've fixed this problem for myself temporary. I can send the code-changes, when needed. Stefan Anzinger=20 GoldenSource Corporation Development Center Austria A-4066 Pasching, Plus-Kaufstr.7=20 Phone +43 (7229) 76656-51=20 Fax +43 (7229) 76656-99=20 E-mail: san...@th...=20 http://www.thegoldensource.com This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any erroneous transmission. If you receive this message in error, please immediately destroy it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, or copy any part of this message if you are not the intended recipient. |