D
danep
Basically, my problem is exactly as described in the subject. The
problem is somewhat intermittent and unpredictable, but the majority
of the time if I just have a statement such as
window.onload=location.hash('somewhere');
the URL is indeed appended, i.e. www.example.com/index.php#somewhere,
but window itself doesn't actually move to the bookmark. However, if
I do something like
window.onload=setTimeout("location.hash('somewhere')",0)
it works fine. On very large pages, the timeout actually has to be a
second or two. Any idea why this is happening? I don't know much
about JS, but my thought is that it's trying to move to that bookmark
before it has actually been loaded in the page; the timeout forces it
to wait for the rest of the page to load before going to the bookmark.
Any thoughts?
problem is somewhat intermittent and unpredictable, but the majority
of the time if I just have a statement such as
window.onload=location.hash('somewhere');
the URL is indeed appended, i.e. www.example.com/index.php#somewhere,
but window itself doesn't actually move to the bookmark. However, if
I do something like
window.onload=setTimeout("location.hash('somewhere')",0)
it works fine. On very large pages, the timeout actually has to be a
second or two. Any idea why this is happening? I don't know much
about JS, but my thought is that it's trying to move to that bookmark
before it has actually been loaded in the page; the timeout forces it
to wait for the rest of the page to load before going to the bookmark.
Any thoughts?