If my URL is example.com/controller/method/,
using this ajax code changes the URL to example.com/controller/method/method which is not retrieving data.
function getProductList() {
var category = document.getElementById('Category').value;
$.ajax({
type: 'POST',
url: 'GetProductList',
data: {CategoryId: category},
dataType: 'json',
cache:false,
success: function (response) {
}
});
}
However, if the URL is example.com/controller/method, the ajax call retrieves data correctly. I need to be able to access data from the database in both situations.