Shizlles Posted June 24, 2012 Share Posted June 24, 2012 Hey, I have a variable set up when a message is sent or a post is made on my website. Now i would like to spice it up and instead of just displaying a messagei found a script that creates a neat little popup on the right hand side. For this to work i tried someting like this: <?php if($messageSent){ echo '<script type='text/javascript'> sNotify.addToQueue("You message has been sent");</script>'; };?> But this doesnt seem to work. Any suggestions on what im doing wrong? Help would greatly be appreciated as im still quite new to this.Thanks Link to comment Share on other sites More sharing options...
Shizlles Posted June 24, 2012 Author Share Posted June 24, 2012 Ah i found the solution <?php if($messageSent){ echo '<script type="text/javascript"> sNotify.addToQueue("Your message has been sent");</script>'; };?> This code works, double quotes save the day! Link to comment Share on other sites More sharing options...
astralaaron Posted June 24, 2012 Share Posted June 24, 2012 The backslash ( \ ) can fix that problem too by escaping the quote ( ' ) . <?php if($messageSent){ echo '<script type=\'text/javascript\'> sNotify.addToQueue("Your message has been sent");</script>'; };?> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now