I am running WordPress on my localhost and trying to send request from a file of my plugin to another file called photos.php using ajax, I have correctly written the address of file in xmlhttp.open function but it runs into following error.
Not Found
The requested URL /wordpress/wp-admin/wp-content/plugins/myphoto/photos.php was not found on this server.
the actual address of the file is /wordpress/wp-content/plugins/myphoto/photos.php
xmlhttp.open("GET","wp-content/plugins/myphoto/photos.php?c="+option,true);
xmlhttp.send();
Try setting the absolute path:
Your error implies you’re using the relative path. Directory
/wordpress/wp-admin/wp-content...does not exist.