S
S
step-olga2015-10-18 20:25:12
JavaScript
step-olga, 2015-10-18 20:25:12

Why doesn't alert work?

The page has the code:

echo "<script>alert(\"Сообщение отправлено!\");</script>";

Why is the script not displaying a message?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
petyagrill, 2015-10-18
@petyagrill

This is how it should work:

echo "<script>alert('Сообщение отправлено!');</script>";

P
Puma Thailand, 2015-10-18
@opium

too many quotes

V
Vladislav Startsev, 2015-10-19
@esvlad

Try enabling the PHP interpreter.
Since any of these options work fine:

<?php
echo "<script>alert(\"Сообщение отправлено!\");</script>";
echo "<script>alert('Сообщение отправлено!');</script>";
echo "<script>alert(\"Сообщение отправлено!\")</script>";
?>
<?='<script>alert("Сообщение отправлено!");</script>';?>
<%='<script>alert("Сообщение отправлено!");</script>';%>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question