Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 10-27-2006, 08:35 AM   #1 (permalink)
Lover - Protector - Teacher
 
Jinn's Avatar
 
Location: Seattle, WA
[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.
__________________
"I'm typing on a computer of science, which is being sent by science wires to a little science server where you can access it. I'm not typing on a computer of philosophy or religion or whatever other thing you think can be used to understand the universe because they're a poor substitute in the role of understanding the universe which exists independent from ourselves." - Willravel
Jinn is offline  
Old 10-28-2006, 03:31 PM   #2 (permalink)
aka: freakylongname
 
Chamaeleontidae's Avatar
 
Location: South of the Great While North
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...
__________________
"Reality is just a crutch for people who can't cope with drugs."
Robin Williams.
Chamaeleontidae is offline  
Old 11-04-2006, 12:28 PM   #3 (permalink)
Psycho
 
noodles's Avatar
 
Location: sc
Code:
<a href="#anchor" onclick="javascript:callTheFunctionHere()">
__________________
This is what is hardest: to close the open hand because one loves.
Nietzsche
noodles is offline  
 

Tags
anchor, execute, javascript, javascript or htmljump


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 09:08 PM.

Tilted Forum Project

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

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 47 48 49 50 51 52 53 54