Hi I have a jquery popup script I am trying to call in a php function.
The script calling the function is:
<link rel='stylesheet' href='css/sweetalert.css'>
<script src='js/sweetalert-dev.js'></script>
<script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>
<?php
include('functions/notification.php');
$notification_message = "There is a problem loading Smart Telecom at the moment.";
notify($notification_message);
?>
and the function call in notification.php:
<?php
function notify($message)
{
$pop.= "<script>sweetAlert('". $message ."', 'Our Sincere apologies.', 'error');</script>";
echo $pop;
}
?>
As it is, the pop up will display with an error about undefined variable $pop. If I try to disable error notifications, the popup doesn't display. if I do it without the concatenation, the popup also doesn't display.
Where am I going wrong?
UPDATE - SOLVED:
Got it to work. echoed "nbsp;", just before echoing $pop