I have a custom.js with post request
function setPrayerTime(cityId) { var request = $.ajax({ url: "http://site.com/mymodule/namaz_mob/prayer.v2.php", type: "POST", data: { cityId : cityId }, dataType: "json", beforeSend: function( xhr ) { $( ".namazcontainer" ).addClass( "times-loading" ); } });
So, my PHP file is located at site.com/mymodule/namaz_mob/prayer.v2.php
, but joomla always redirection to site.com/prayer.v2.php
if you're on the front page of the site i.e. http://site.com
the ajax request will go to http://site.com/prayer.v2.php
while on a page at http://site.comblog/mypost01
it will map to http://site.com/blog/prayer.v2.php
.
How to send ajax request of the address where located my php file prayer.v2.php
within com_ajax
mymodule
a module in your modules folder or external folder placed in root directory?