I am working on a function which will post some data – position of a flag/pin on the image trough api.
I am having a problem of passing position details.
function sendOnClick() {
function get_posx() {
var relx = $("#image_edit").click(function(e) {
var relX = e.pageX - this.offsetLeft;
return relX
});
return relx;
}
jQuery.post('{% url case_image_detail_api case.pk image.pk %}', {
'id' : '{{image.id}}',
'image_posx' : get_posx(),
'image_posy' : get_posx(),
});
};
Error:
NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument
As the comments above said,
sendOnClickshould be the event handler: