jquery - Parsing Json feed from Solr -


i'm experiencing strange behavior parsing feed solr. dont response using url1. if use url2 instead, in both cases got responses putting url directly browser. please, doing wrong?

<script type='text/javascript'>   var searchterms = $('#input_box').val();   var searchfield = $('#dropdown').val();    var url1 ="http://localhost:8983/solr/moogle/select?q="+searchfield+"%3a%28"+searchterms+"%29&wt=json&indent=true";   var url2 = 'http://localhost:8983/solr/moogle/select/?wt=json&json.wrf=?&q='+searchfield+':('+searchterms+')'    $.getjson(url1, function(result){      alert("hello"+result.response.docs[0].title);  }); </script> 

i found solution. it's browser cross-domain scripting issue associated running solr on different port webpage. fixed issue including json.wrf=? parameter in url:

"http://localhost:8983/solr/moogle/select?q="+searchfield+"%3a%28"+searchterms +"%29&wt=json&indent=true&json.wrf=?" 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -