Possible Duplicate:
passing variables from php to javascript
I am using this awesome jQuery Stick Notification Plugin which creates notifications upon clicking various buttons.
I used the following code to display the notification box…
$(".notify").click(function() {
$.sticky('The page has loaded!');
});
Can i make it display some PHP variables in place of static text message?
Hope i’ve made it clear enough.
Without making asynchronous HTTP calls, you will have to insert the PHP variable at server-side:
Wrap it with
htmlentities()just in case$messagecontains some chars that make the JavaScript string invalid.