I'm developing my custom component and I need to call some task from back-end controller during editing a single record. The url of my record edit page in the back-end is:
.../administrator/index.php?option=com_mycom&view=page&layout=edit&id=2
There is my ajax-query for calling a task in the record controller:
$.ajax({
method: "POST",
cache: false,
url: 'index.php?option=com_mycom&task=deleteimg&format=raw&id=<?php echo $this->item->id; ?>',
data: {id: '<?php echo $this->item->id; ?>'}
}).done(function() {
alert('Deleted');
});
return false;
I tried also the urls:
index.php?option=com_mycom&controller=record&task=deleteimg&format=raw&id=...
index.php?option=com_mycom&controller=record&view=record&layout=edit&task=deleteimg&format=raw&id=...
But every time console displays me the 404 error:
POST ...//domain.com/administrator/index.php?...&id=2 404 (... [name, type, prefix]: pages, raw, mycomView)
What the correct url should be?