I would define the url simply like the following:
(If in the console you would see error due to double slash in the ajax request url, then try it also without slash at the beginning of the url)(And as @Sharky pointed to it in the comment, if the url starts without the leading slash, then the url will always point to the root, even if Joomla is intalled in a subfolder).
It should work this way. In the above, you can see that the first segment of the url (after index.php?) starts with com_mypage as it has to be your component name (or the component name which you communicate with). It will never work if it is just a page. It must be like: option=com_virtuemart or option=com_j2store or some other component name.
The other parts of the url look OK. (However, the task segment should be &task=mycontrollerfunction of the component).
I just do not see any reason to define the base path in the ajax url if you start this call from inside Joomla, it’s just totally unnecessary (and it will never work the way you tried, since in jQuery it does not mean anything).
I mean in jQuery you could start your url with the base like:
window.location.protocol + "//" + window.location.host + “/index.php?...”
But for this ajax call you really do not need that.