Posted by boclair on 04/07/07 00:21
H@C0 wrote:
> Hi,
> Is it possible to use javascript to detect the current page and disable the
> link?
> Does anybody know a method to disable the link to the current loaded page or
> a website with an example?
>
> Regards, Hans
Having javascript anywhere near navigation is fraught. There are a
number php methods to not display the hyperlink to current page.
An example
<?php
$thisfile=(basename ($_SERVER['PHP_SELF']));
if ($thisfile=="page1.php")
{$page1="style='display:none;'";}
else {$page1="";}
if ($thisfile=="page2.php")
{$page2="style='display:none;'";}
else {$page2="";}
?>
______markup_____
<a href="page1.php" <?=$page1;?>>Page 1</a>
<a href="page2.php" <?=$page2;?>>Page 2</a>
Louise
Navigation:
[Reply to this message]
|