Using AJAX to access the content of a view I have a simple view with one exposed filter that displays a table view of contents.(for example nodes are some addresses with the exposed filter of the city). And I made a map for cities;I want that whenever user clicks on a city in the map, the selected city become exposed filter of view and view become refreshed without refreshing the whole page.is it possible?
I thought that I can use something like:

$.get(
'/myviewpage',
{myfield=14},
function(data){  $('#SomeOtherDiv').html(data) }
);


I tried that but I got unauthorized error. if it's correct; how can I make a page view-able for everyone?
thanks
First, enable Ajax on the view. On window load, bind the click event to a custom function, let's call it getInfo(arg) and pass the arguments you need (nid, tid, or whatever you need)

Then, on getInfo() add the following code.

function getInfo(args) {
  $.ajax({
    url: '/views/ajax',
    type: 'post',
    data: {
      view_name: 'your_view_name',
      view_display_id: 'block_1', //your display id
      view_args: args,
    },
    dataType: 'json',
    success: function (response) {
      if (response[1] !== undefined) {
        var viewHtml = response[1].data;
        $('#myDiv').html(viewHtml);
        Drupal.attachBehaviors(); //check if you need this.
      }
    }
  });
}


You pass the arguments in the data array, and you get the #myDiv replaced with the view content.