Reputation: 1934
I am wondering how I can send data. I have the following code
$( "#dialog" ).load('/events/relates ' + '#eventconfirm', { data: 'Hello World' }).dialog('open');
But it doesn't work. What I want is to load event/relates
and only get the selection #eventconfirm
, which works, but I would like to add data so the controller can read the params[:data]
and act upon it.
Upvotes: 3
Views: 679
Reputation: 1
Please try this:
$('.div').load("/test/okay?test=1");
where test=1 is params
Upvotes: 0
Reputation: 2620
no need to append the url and try calling the plugin in the .load
callback like
$("#dialog").dialog();//first initailize the plugin
//then load the content
$( "#dialog" ).load('/events/relates#eventconfirm', { data: 'Hello World' },function(data){
$(this).dialog('open');
});
Upvotes: 1