Skip to main content

jdic WebBrowser, setUrl and Anchor Tags

2 replies [Last post]
srfx
Offline
Joined: 2009-02-10

Hi, I'd like (and tried) to do something like this:

webBrowser.setURL(new URL("file:///C:/myFile.htm#myanchor"));

...load a page at the position set by my anchor.

It didn't work, but it does work for embedded links within my htm. footnotes etc.

So internally webBrowser does understand about anchors, but setURL doesn't know what to do with them?

Am I missing something?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
srfx
Offline
Joined: 2009-02-10

maybe a different tact would work?

Is there a way to mimic an internal redirection (like clicking an embedded link)?

Clicking embedded links works for anchors.

srfx
Offline
Joined: 2009-02-10

I've figured out a work around if someone else needs a solution:

webBrowser.executeScript("window.location.hash = '#myAnchor';");