pavlo pavlo - 1 month ago 4
jQuery Question

How to send query from js code using ajax to server

I have an event, When I clicking right button on the marker

google.maps.event.addListener(marker, 'rightclick', (function (marker) {
it returns function:
return function () { marker.setMap(null); delete markerBusyBrID[this.marker]; deleteBrigade(); //As I think I need something here to start my ajax query }
in that code I need to send request to ajax
Here is a part of code:

google.maps.event.addListener(marker, 'rightclick', (function (marker) {
return function () {
marker.setMap(null);
delete markerBusyBrID[this.marker];
deleteBrigade();
//here must be start of my ajax query
}


My servlet name
getChangeBrigadeStatus

and my parameter which I need to send
brigadeNumber

I don't understand how to send ajax query.

Answer

Sorry guys for my stupidity. Till I waited for answers and help I have looked to another topics. And one new topic has pushed me that it' so easy, but it's all of my little knowledge: here is a code:

               google.maps.event.addListener(marker, 'rightclick', (function (marker) {
                return function () {
                    marker.setMap(null);
                    delete markerBusyBrID[this.marker];
                    deleteBrigade();
                    $.get('getChangeBrigadeStatusFreeFromBrigade', {brigadeNumber: brigadeNumber}, function () {
                    });

But this code will help me in other things which I also didn't knew how to solve