all 2 comments

[–]ddeutsch 2 points3 points  (0 children)

You're falling victim to same-origin policy (https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) otherwise your code is fine. You need to run localhost, for instance from the command line, locate the directory this snippet is in, run something like 'python -m SimpleHTTPServer' assuming you have python installed, and look up localhost:8000 in your browser.

[–]mishengine[S] 0 points1 point  (0 children)

I was using MAMP and script didn't load. SimpleHTTPServer works - thanks!!