Solved

How can I use jQuery blockUI to display a variable

Posted on 2012-03-19
3
1,046 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

707 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