I have an ASP.NET MVC web application running from http://localhost/myappname
. From jQuery, I make jQuery $.ajax() calls to return partial views based on some
I was able to accomplish this with straight JavaScript using window.location.pathname
. See the following example:
function loadMyPartialView() {
$.ajax({
type: 'GET',
url: window.location.pathname + 'Home/GetNavigationTreePV/',
success: function (data) { onSuccess(data); },
error: function (errorData) { onError(errorData); }
});
return true;
}