my el6.href and el7.href doesn’t work,
if I place el6.href and el7.href at top of el4.href and el5.href IT WORKS but as consequence el4. and el5 won’t work,
any tips?
script
el4 = document.getElementById("edit_href");
el5 = document.getElementById("delete_href");
el6 = document.getElementById("approve_href");
el7 = document.getElementById("deny_href");
el4.href = "../article/submit-article.php?";
el5.href = "myaccount.php?mydraft=true&delete=true";
el6.href = "myaccount.php?rec_approved=true&approve=true";
el7.href = "myaccount.php?rec_denied&deny=true";
php
if(isset($_GET['mydraft']))
{echo"
< href='' id=edit_href >edit</a>
<a href='' id=delete_href >delete</a>";
}
if ( (isset($_GET['rec_waiting'])) || (isset($_GET['rec_denied'])) )
{echo"
<a href='' id=approve_href >approve</a>";
if(!isset($_GET['rec_denied']))
{echo"
<a href='' id=deny_href >deny </a>";
}
}
Javsscript code need not null judgment.because some element is null.look this.
HTML documnet is From top to bottom of the execution.if Appear the wrong in javascript tag middle.So the code after will not be executed