Larry has an excellent point.
Firefox 3.5+ is supposed to support cross domain XMLHttpRequests
See:
https://developer.mozilla.org/En/HTTP_Access_Control
But it is likely not realistic to expect users to always be using FF
3.5+ or a different browser with the same feature.
Here's a modified suggestion.
If you have access to server-side scripting then you could
1. Send an XMLHttpRequest to your own server
2. That request would cause a script to run on your server
3. That script would simply try to read the kml headers and report
back to the javascript on the client machine
A server-side script can read across domains with no problem.
My app does exactly that.
In fact, you are welcome to use my app to try and read any of your
good/bad/ugly kml files. Bad kml files/urls should produce an error
message.
The simplest syntax is:
http://www.mappingsupport.com/p/gmap4.php?q=http:url_to_your_file.kml