I used jQuery's `$.ajax()` to send requests to SOLR server and fetch results in JSON but it didn't work. My code was correct and thus I could not figure out what was wrong. If I paste the URL in the address bar of the browser, I get correct the JSON output.

I Googled it and found some similar questions on Stack Overflow: one question said to use `$.getJSON` instead, without giving any reason, but that also didn't work for me.

Now, I know there is a AJAX-SOLR framework and I am going to use it, but I would like to know why there are issues with SOLR and jQuery.

Following is my attempt at using `$.getJSON`, in case it turns out to be my mistake.

```
$('#searchForm').on('submit', function(){
    // get the user entered search query
    var query = $('#queryBox').val();

    // send the AJAX request to solr and get the results
    $.getJSON('http://localhost:8983/solr/select/?q='+query+'&wt=json&indent=true', function(searchResult){
        alert('success');
    });

    alert(query);

    return false;
});

```

I don't get the 'success' alert. The callback function is never executed. How can I fix this?