Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

navigate to a linked target on html page without page refresh

how do I navigate to a <a> linked target on html page without having to reload php generated content. if I click on a link to a target such as 'Top of Page', it refreshes to entire page content.
0
mmarth
Asked:
mmarth
  • 3
1 Solution
 
Robert SchuttSoftware EngineerCommented:
For this usually a hash sign is used:
<a href="#">Top of Page</a>

Open in new window

0
 
COBOLdinosaurCommented:
Any element with an id can be targeted with
<a href="#someid">Go to ID</a>

There are a whole range of effects using targets


Cd&
0
 
Robert SchuttSoftware EngineerCommented:
You can add target id's to your page, making it possible to link to different sections, or have it done automatically: http://www.kryogenix.org/code/browser/generated-toc/
0
 
mmarthAuthor Commented:
my problem was that i was creating a php button which had a submit as the link. thanks
0
 
Robert SchuttSoftware EngineerCommented:
Hmm, not sure how my solution helped you in that case. I assume you just made sure the "#someid" was included in the action url or redirected url from that action page.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now