Problem with code for JQUERY NOVICE TO NINJA

I am just getting into JavaScript and have been working through the 2nd edition of the book.

This is an excellent introduction, with lots of information and examples.
However, I ran into a problem with the tabs examples using jquery_ui in Chap 5
I am using the downloaded code – Chap 5, Exs 12-14…

The tabs are not loading the external files. I have the same problem with both Chrome and IE.
Any suggestions?
Thanks.

Hmm. I got the code working on Chrome by launching Chrome with the command line option --allow-file-access-from-files.
Still not sure about IE, but it is probably something similar.

Yeah, this falls foul of Chrome’s same-origin access policy.

If you look at the console you see (although your paths will differ):

Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. file:///F:/Files/Code%20archives/Sitepoint%20-%20jQuery%20-%20Novice%20to%20Ninja/chapter_05/12_jquery_ui_tabs/about.html

XMLHttpRequest cannot load file:///F:/Files/Code%20archives/Sitepoint%20-%20jQuery%20-%20Novice%20to%20Ninja/chapter_05/12_jquery_ui_tabs/about.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. index.html:1

Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. file:///F:/Files/Code%20archives/Sitepoint%20-%20jQuery%20-%20Novice%20to%20Ninja/chapter_05/12_jquery_ui_tabs/disclaimer.html

XMLHttpRequest cannot load file:///F:/Files/Code%20archives/Sitepoint%20-%20jQuery%20-%20Novice%20to%20Ninja/chapter_05/12_jquery_ui_tabs/disclaimer.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. index.html:1

To get around this, simply launch Chrome with the correct flags (as you did) or use a server stack such as xampp.

Shouldn’t be a problem in IE though.