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>
答案 0 :(得分:1)
数字符号(#)后不发送到服务器和浏览器。所以先写get参数,然后添加#。浏览器认为#之后的所有字符都是元素ID。
<a href="<?php echo $site_url.'contact?title='.$data['page']['slug'].'#scrollid' ?>" >
Deelnemen
</a>