Solved

jquery Dialog with php and ajax

Posted on 2014-03-11
5
661 Views
Last Modified: 2014-03-28
Hi,

I have this code inside the document ready jquery..., and works perfect making the append, but i need to change the append to a dialog box

$("td").click(
	
	function (){
		
			$this = $(this);
			$.ajax({
		url:"interrupcionesFeeder.php",
		type:"POST",
		data: {feeder:$(this).html()},success: interrupcionesSeccion});
			
		function interrupcionesSeccion(datos){
		
			$this.append(datos);
		}

Open in new window


and this other

<script type="text/javascript">

$(function(){
	$("#dialog").dialog({
		autoOpen: false,
		show: {
			effect: "blind",
			duration: 1000
		},
		hide: {
			effect: "explode",
			duration:1000
		}
	});
	
	$("#opener").click(function(){
		$("#dialog").dialog("open");
	});
});


</script>

Open in new window


I need to adjust this code for when a user click a td, then run the ajax and the return from the ajax go inside the dialog box, any idea?
0
Comment
Question by:joyacv2
  • 3
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
So just change the append

$this.append(datos);
to
$("#dialog").(datos);
Change the targetting to where it should be appended
0
 
LVL 1

Author Comment

by:joyacv2
Comment Utility
Hi,

I change that line and nothing happens, any other idea?
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
Oops missed something

$("#dialog").append(datos);
0
 
LVL 1

Author Comment

by:joyacv2
Comment Utility
Hi,

Still not working,, the code don't do anything, any other idea?
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Post the HTML of your dialog code.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

17 Experts available now in Live!

Get 1:1 Help Now