I have this piece of code into my php file:
<?php
if(isset($_POST['submit'])){
if($_POST['email'] != ''){
$email = $_POST['email'];
$query = "INSERT INTO user(email) VALUES('". $email . "')";
$stmt = $db ->query($query);
if($stmt){
echo "<script>displayPopup('success')</script>";
}else{
echo "";
}
}
}
?>
My JS file is included before the closing tag and it's well charged. But I have error saying the function displayPopup is not defined
Any idea ? :(
jQuerycheck the$(document).ready();function