![]() |
[Javascript/HTML]Jump to anchor AND execute javascript?
I've got a javascript function "sendRequest" that I wrote which replaces a div called "article" in my page with text given to it by a PHP function. They're news articles.
The articles themselves also have the links javascript:sendRequest('articlename');" in them. If the user has scrolled far down in the document and clicks the link, it replaces the div with the new article. However, it doesn't jump to the top like typical Web users would expect. Is there a way to jump to a #id within the page after calling the javascript div replace? Thanks in advance. |
Here is the Javascript function call as a link in like this
Code:
<a href="javascript:scroll(0,0)">Top</a> |
Code:
<a href="#anchor" onclick="javascript:callTheFunctionHere()"> |
All times are GMT -8. The time now is 05:45 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project