Solved

How can I use jQuery blockUI to display a variable

Posted on 2012-03-19
3
1,014 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:sjtinsley83
  • 2
3 Comments
 
LVL 58

Expert Comment

by:amit_g
Comment Utility
You almost got it...

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

Open in new window

0
 

Author Comment

by:sjtinsley83
Comment Utility
How can I have some text and use the variable??
0
 
LVL 58

Accepted Solution

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

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now