Reputation: 1869
im trying to insert a ajax loaded content after a div tag
$('#optionheader').after($.load('calendar', {'requestType':'loadMenu'}));
can anybody tell me where the error is?
thx
Upvotes: 0
Views: 1519
Reputation: 1969
Try
var div = $("<div />");
div.load('calendar', {'requestType':'loadMenu'});
$("#optionheader").after(div);
Upvotes: 1
Reputation: 1035
You can use $.get for this:
$.get('/calendar', {'requestType':'loadMenu'},function(data) {
$("#optionheader").after(data);
});
If you want to do it your way, with .load, you could do it like this
$("#optionheader").after($('<div />').load('/calendar',{'requestType':'loadMenu'});
This should add a div to the #optionheader tag and load it with the result of /calendar
Upvotes: 1