FuriousRise
FuriousRise

Reputation: 23

<a href=""> with #scrollid and a GET variable

I hope someone can help me with this problem. I'm trying to give this href an GET id, but the url alreay has a #scrollid what means it will scroll to a the place on the page where the #scrollid is. but whenever I try to add an GET id to the url the #scrollid doesn't work anymore.

<a href="<?php echo $site_url, 'contact#scrollid?title=', 
$data['page']['slug']?>"Deelnemen</a>

Upvotes: 1

Views: 52

Answers (1)

Mohammad Hamedani
Mohammad Hamedani

Reputation: 3354

After number sign (#) not send to server and for browser. So first write get parameter, then add #. Browser thinks all characters after # is element id.

<a href="<?php echo $site_url.'contact?title='.$data['page']['slug'].'#scrollid' ?>" >
  Deelnemen
</a>

Upvotes: 1

Related Questions