I am trying to implement autocomeplete box in a custom webpart in sharepoint 2007. When i use a static file in same domain (for textbox with id f1) everything works fine but when I use a remote url that gives a json output (for textbox with id f2), it gives a Permission Denied error in javascript. In the final page following is the HTML generated -
$('#f1').autocomplete('documents/staticfile.txt');
$('#f2').autocomplete('http://url_that_spits_out_json',
{ dataType:"json",
formatItem: function(data,i,max,value,term){ return value; },
parse: function(data) {
var array = new Array();
for(var i=0;i<data.length;i++) {
array[array.length] = { data:data[i], value: data[i].text, result: data[i].text};
}
return array;
}
});
Since its working fine for f1, to me it looks like something to do with sharepoint. Anyone has any idea, how to do this?