I have a probl开发者_StackOverflow社区em calling an action using javascript. So, I calculate a distance between two latitudes and longitudes. Now, If that distance is greater than 100 miles I want to call "distant" action in home controller that would return different view, but if it's less I would like to stay with index action. Any ideas? Thank you!
Why can't you just do something like:
if (distance > 100) {
$.ajax({url: 'distantURL', ...});
} else {
$.ajax({url: 'closeURL", ...});
}
Without additional information, it's tough to give a more detailed and/or accurate answer.
EDIT: Here's a nice walk-through tutorial of loading a partial view via jQuery's $.ajax()
function, which sounds like what you want to do.
精彩评论