I'm quite new to jquery... I'm working with ToastMessge plugin (demo and download here)..
I'd like to pass name of Toastmessage function by reference to another function's argument but the following doesn't work :
$(document).ready(function() {
function switchMsgType(fref)
{
var fname = null;
fref(fname);
}
var alfa = $("#msgtype").html();
switchMsgType(alfa);
});
html:
<body>
<div id="msgtype"><?php echo $_GET['msgtype']; ?></div>
<div id="msg">bla bla ....</div> <!-- txt of the message -->
...
The only working version that i have is this :
...
switchMsgType(showStickySuccessToast);
...
but i must have sonething in the page to keep my PHP $_GET msgtype.... so i can switch from 'Warning' to 'Success', etc... I already tried with :
$.trim($("#msgtype").text()); or... $.trim($("#msgtype").html());
and others.. but nothing... Thanks in advance... :)