I have a link ?view=foo
. If selected, a div id="view"
gets added into which a file is included. div gets closed and a link #view
is added to jump back to the beginning of the included file. All fine. Thing is, the #view
link doesn't do anything. Is this because the div is dynamic? Doesn't seem to make any difference if I add the div as part of the static mark-up though. URL rewriting? Split, Explode? What -- if any -- would be the best approach to make the #view
link work? Sample code below.
if (isset ($_GET['view']) && ($_GET['view'] != '')) {
$view = $_GET['view'];
echo '<div id="view">';
include ($view);
echo '</div>';
echo '<a href="#view">Top</a>';
}
EDIT: Fixed by adding hastag just above dynamic stuff. Thanks anyway.