i am trying to run an alarm box (pop up) within an ASP if-else statement.
ex:
<%
if not a=b then
%>
<script type="text/javascript">
alert("I am an alert box!!")
</script>
<%
end if
%>
but not working...anyone know how to do?
Printable View
i am trying to run an alarm box (pop up) within an ASP if-else statement.
ex:
<%
if not a=b then
%>
<script type="text/javascript">
alert("I am an alert box!!")
</script>
<%
end if
%>
but not working...anyone know how to do?
Have you looked at the HTML that gets generated - what does it have in it?
it has the script generated no matter what
<script type="text/javascript">
alert("I am an alert box!!")
</script>
means, the if-else statement puts no effect.
ps: the script is within <head></head>.
Yes, because thats exactly what you are doing, displaying it no matter what..Quote:
Originally Posted by 0124
Why not print it instead, e.g. for PHP I would do:
echo '<script>alert("Hiii");</script>';
Peace,