Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   [Javascript/HTML]Jump to anchor AND execute javascript? (https://thetfp.com/tfp/tilted-technology/109987-javascript-html-jump-anchor-execute-javascript.html)

Jinn 10-27-2006 08:35 AM

[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.

Chamaeleontidae 10-28-2006 03:31 PM

Here is the Javascript function call as a link in like this
Code:

<a href="javascript:scroll(0,0)">Top</a>
use the link or just the function itself...

noodles 11-04-2006 12:28 PM

Code:

<a href="#anchor" onclick="javascript:callTheFunctionHere()">


All times are GMT -8. The time now is 05:24 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46