If startDateTime
& endDateTime
have are dateTime values along the lines of this:
Start: Mon Jan 10 2011 18:15:00 GMT+0000 (GMT Standard Time)
End: Mon Jan 10 2011 18:45:00 GMT+0000 (GMT Standard Time)
How do you pass both startDateTime
& endDateTime
to the ajax call below?
eventNew : function(calEvent, event)
{
var startDateTime = calEvent.start;
var endDateTime = calEvent.end;
jQuery.ajax(
{
url: '/eventnew/',
cache: false,
data: /** How to pass startDateTime & endDateTime here? */,
type: 'POST',
success: function(response)
{
// do something with response
}
});
},
Try:
data: {
start: startDateTime,
end: endDateTime
}
This will create request parameters of 'start' and 'end' on the server that you can use.
The {...}
is an object literal, which is an easy way to create objects. The .ajax
function takes the object and translates its properties (in this case, 'start' and 'end') into key/value pairs that are set as properties on the HTTP request that gets sent to the server.
data: {
startDateTime : "xxx",
endDateTime : "yyy"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With