kamranahmedse / jquery-toast-plugin

Highly customizable jquery plugin to show toast messages
http://kamranahmed.info/toast
1.51k stars 507 forks source link

display variable as text? #11

Closed geronimoooooooo closed 8 years ago

geronimoooooooo commented 8 years ago

Hi, Is it possible to display the content of a string variable as text in the toast?

var string_variable = "this is my dynamic text";

$.toast({ text : " $('string_variable').val()" }

greetings

kamranahmedse commented 8 years ago

Not sure, what you mean by that. You can definitely pass variable values, after all it is javascript.

However, in your example, you seem to have double quotes around $('string_variable').val(). Try

$.toast({
    text : $('your_selector').val()
});

Or

$.toast($('your_selector').val());