How can I use jQuery blockUI to display a variable

I am using blockUI to display a waiting message while an ajax request is submitted. When the ajax request returns successful I am using blockUI to show a successful message. Within that message I would like to display the contents of data.message but I am unsure how to do this.

This is the ajax success code...

		success: function(data) {
			if (data.status == "success") {

				alert("SUCCESS " + data.message);   //Used to test variable

				$.blockUI({ message: 'SUCCESS' . data.message });

				setTimeout(function(){$.unblockUI;
				window.location.href = "index.php";
				}, 3000);

Open in new window


Could someone help?

Thanks

Steve
Steve TinsleyAsked:
Who is Participating?
 
amit_gCommented:
$.blockUI({ message: "Some text " + data.message });

Open in new window

0
 
amit_gCommented:
You almost got it...

$.blockUI({ message: data.message });

Open in new window

0
 
Steve TinsleyAuthor Commented:
How can I have some text and use the variable??
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.