ajax type head and cross domain to check file existence

ajax type head and cross domain to check file existence

Hi

i have a server , for example , www.me.com

i have another server, for example, www.you.com

i use this code

$.ajax({ url:'http://www.you.com/afile.txt', type:'HEAD', error: function(){ console.log(file not found); }, success: function(){ console.log("a file here"); } })

but i obtain cross domain issue :

XMLHttpRequest cannot load http://www.you.com/afile.txt Origin http://www.me.com is not allowed by Access-Control-Allow-Origin.


i'm the owner of you.com so i can modify it.

how to define a javascript crossdomain file?

thanks