force an iframe to scroll to anchors passed by querystring in Firefox
I have a php page A, inside this page I have an iframe with a source (attribute src="") like <iframe src="book.html"></iframe> The "book.html" is a page with a lot of text divided in sections and contain html anchors (<a name="anchor-1"></a>) before each block of text I have another php page B with a form that pass a variable (#anchor-1), that is an anchor name, to page A. Inside page A I pass this variable to the iframe, editing the source of the iframe: <iframe src="book.html#anchor-1"></iframe> So I expect the page book.html inside the iframe will scroll to the anchor passed, like normally a html page do. I want this will work with all the browsers; with Chrome works (iframe scroll to the anchor) but with Firefox not. The question is: how can I force the iframe to scroll to anchors passed by querystring in Firefox, maybe with javascript or jquery? https://bugzilla.mozilla.org/show_bug.cgi?id=638598 I found solutions to force the use of anchors with links inside the iframe page "book.html" but not for my case of anchors passed by querystring.
Được chỉnh sửa bởi steplab vào