Solved

How can I use jQuery blockUI to display a variable

Posted on 2012-03-19
3
1,021 Views
Last Modified: 2012-03-23
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
0
Comment
Question by:Steve Tinsley
  • 2
3 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 37740605
You almost got it...

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

Open in new window

0
 

Author Comment

by:Steve Tinsley
ID: 37740957
How can I have some text and use the variable??
0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 37743205
$.blockUI({ message: "Some text " + data.message });

Open in new window

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question