Ajax response in a modal box

Hello guys,
I was wondering if I could display the ajax response in a modal
box. I could not find anything satisfying on the web. I am new to ajax.

This is what I was trying.

$(document).ready(function() {
var clicked1;
$(".inline").click(function(e) {
clicked1 = $(this).text();

$.ajax({
type: ‘GET’,
url:’/controller_path’,
async: false,
data:{ foo1:clicked1
},
success:function(data){
$(".inline").colorbox({inline:true,
width:“35%”,height:“200px”}).show();
}
});
});
});

And my div is hidden at the beginning.

I want to display the controller response in the div and show it as a
modal box.

I am getting the response from controller but how do I put it into the
modal box? I am jus getting an empty modal view.

Nikhil

Guys I figured it out.

$(document).ready(function() {
var clicked1;
$(".inline").click(function(e) {
clicked1 = $(this).text();

$.ajax({
type: ‘GET’,
url:’/controller_path’,
async: false,
data:{ foo1:clicked1
},
success:function(data){
$.colorbox({html: ur_data_from_controller,
width:“35%”,height:“400px”});
}
});
});
});

And you dont need that div.

Nikhil

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs