If the file is parallel to the loaded file , then able do ajax call and get the file data . Request is as like below
$.ajax({
url:'test/file.html',
type:'GET',
dataType : 'text',
crossDomain : true
})
But when the file is in other folder then unable get the data of that file with ajax call in local environment. Below code is unable to get the data from the passed url in MOZILLA. setted Access-Control-Allow-Origin in header , but still observing the issue.
$.ajaxSetup({
headers : {
'Access-Control-Allow-Origin' : '*'
}
});
$.ajax({
url:'../test/file.html',
type:'GET',
dataType : 'text',
crossDomain : true
})
Any suggestions to overcome the issue from the scripting layer will be great.