This seems like a fairly simple question, but I've been searching through google and can't find a solution.
function showJQueryAlert() {
echo '<link rel="stylesheet" href="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="functions.js"></script>
<script type="text/javascript"> $(document).ready(function() { JQueryAlert("INSERT MESSAGE HERE!", 120, false); }); </script>';
outputs the popup with the message "INSERT MESSAGE HERE!". But
function showJQueryAlert($message) {
echo '<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="functions.js"></script>
<script type="text/javascript"> $(document).ready(function() { JQueryAlert('.$message.', 120, false); }); </script>';
where $message is "INSERT MESSAGE HERE!", fails to output the popup. I've tried all sorts of combinations. So what am I missing?
asked May 18, 2013 at 20:24
user2361103
1012 silver badges13 bronze badges
1 Answer 1
Looks like you forgot some quotes:
JQueryAlert("'.$message.'", 120, false);
answered May 18, 2013 at 20:26
tymeJV
105k14 gold badges165 silver badges158 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default