<div id="error" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="modal_head">Activation</h4>
</div>
<div class="modal-body">
**<p id="error_record"> <?php echo $msg; ?> </p>** \\line 1
<p class="text-warning"><small id="direction"></small></p>
</div>
<div class="modal-footer" align="center">
<button onclick="redirect()" type="button" class="btn btn-primary" >Okay</button>
</div>
</div>
</div>
</div>
I need to compare the string in the div with id "error_record" as follows :
<script>
window.onload=function()
{
$("#error").modal('show');
}
function redirect(){
var val=document.getElementById("error_record").innerHTML; \\line2
alert(val); \\line 3
if(val=="Invalid Link"||val=="Invalid Link."||val=="Empty Link")
{
window.location="index.php";
}
if(val=="Activation Successful"||val=="Your Account is already activated.")
{
window.location="dashboard.php";
}
}
</script>
But it always returns false in the comparison, in comment line 2.
The alert in comment line 3 gives the same string, But the comparison returns false.
Does it have something to do with the echo in line 1?
i have $msg="Empty Link";