Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Scott Wilcox
9,517 PointsMajor site Issue that is holding up the development of my site.
I have a site that I am working on. In it there is a static header, footer, and left side navigation menus. I am doing this all on my local machine, no web services installed.
When someone clicks a nav link in the menu I want the content of the link to load in the right side Div container without reloading all of the elements on the page.
Once I get this working I can develop the page content in the Div, once that element is complete I pull the content out to a new .html that contains just the content of the Div, no html or body tags.
These sub pages will be store in a sub-folder in the site directory.
I have tried .load(); and all I get is an error like this. XMLHttpRequest cannot load file:///C:/Website%20Files/Code%20Test%20files/subpages/suggestion.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
I figured this would be a very simple thing to do. But it is frustrating the hell out of me.
Any help wold be appreciated.
2 Answers
Kevin VanderWulp
5,180 PointsAre you just opening the file in the browser, or are you using an Apache server and going to http://localhost or http://127.0.0.1 to load the page? If you are not using an Apache server, you might want to look into installing one on your computer. I personally use EasyPHP since it is very simple to install, and basically comes pre-configured.
I believe this will fix your problem.
Scott Wilcox
9,517 PointsThank you, that worked beautifully. I was planning on learning Ruby on rails and going that route but after trying to install Ruby on rails as the webserver (headache from hell) I tried php and I am up and running, the server is running perfectly. So I may end up going the php route.