Ok this is just crazy.
A friend of mine is testing out a JavaScript/jQuery stock widget for me. The content of the HTML file he used to test it couldn't be much more simple. It's these two lines:
<script src="http://quandl.io/widgets/js/q.js"></script>
<div name="quandl" data-values="msft revenue"></div>
For him this throws the error "[Error] XMLHttpRequest cannot load http://quandl.io/widgets/data/us-fundamentals.php?ticker=MSFT&indicator=REVENUE. Origin null is not allowed by Access-Control-Allow-Origin."
He sent me his file, and I get the same error. However, oddly in TextWrangler (a plain text editing app), the code in his file appears like this:
However, if I take that code and paste it in a new TextWrangler doc the code looks like this:
And get this: If I save that new file with the exact same code as the other file, the script executes with no problem. Both of these files are being executed from the same place (my local machine). Both, according to the properties I can inspect, are plain HTML files (no weird styling information I can see). It's odd, to say the least.
EDIT 1: Both files are on my local computer which is running Safari, OSX. Though I know this is not 100% kosher for StackOverflow, this problem is likely file-specific, so I'm posting here a link to the files. (But from what I can tell they are both vanilla text files with .html extensions and the same content... which is why this is so confusing)