Sorry this might be a total noob question
I downloaded a backbone example app from github https://github.com/elfsternberg/The-Backbone-Store that, according to its README, “must be installed under a webserver in order to operate correctly.” Indeed, when I open the index file in Chrome, it just displays an html/css with no javascript functionality, with this error
XMLHttpRequest cannot load file:///Users/me/Sites/backbonestore/data/items.json. Origin null is not allowed by Access-Control-Allow-Origin.
I think this might be because of these links in the json data file
"url": "http://www.amazon.com/Door-Religious-Knives/dp/B001FGW0UQ/?tag=quirkey-20"
The tutorial says I need a webserver, even though it doesn’t use a database.
Is there a way to use webkit (I normally work in the Rails environment) when I’m not using Rails? If that’s not the problem, then can you explain how I might get it to work?
One difference between this backbone project and others I have looked at is that it has a make file. Do I have to do anything with that?
The make file
.SUFFIXES: .nw .js .pdf .html .tex
NOTANGLE= notangle
NOWEAVE= noweave
ECHO= /bin/echo
all: index.html store.js
.nw.html:
$(NOWEAVE) -filter l2h -delay -x -index -autodefs c -html $*.nw > $*.html
.nw.tex:
$(NOWEAVE) -x -delay $*.nw > $*.tex #$
.tex.pdf:
xelatex $*.tex; \
while grep -s 'Rerun to get cross-references right' $*.log; \
do \
xelatex *$.tex; \
done
.nw.js:
@ $(ECHO) $(NOTANGLE) -c -R$@ $<
@ - $(NOTANGLE) -c -R$@ $< > $*.nw-js-tmp
@ if [ -s "$*.nw-js-tmp" ]; then \
mv $*.nw-js-tmp $@; \
else \
echo "$@ not found in $<"; \
rm $*.nw-js-tmp; \
fi
store.js: backbonestore.nw
@ $(ECHO) $(NOTANGLE) -c -R$@ $<
@ - $(NOTANGLE) -c -R$@ $< > $*.nw-html-tmp
@ if [ -s "$*.nw-html-tmp" ]; then \
mv $*.nw-html-tmp $@; \
else \
echo "$@ not found in $<"; \
rm $*.nw-tmp; \
fi
index.html: backbonestore.nw
@ $(ECHO) $(NOTANGLE) -c -R$@ $<
@ - $(NOTANGLE) -c -R$@ $< > $*.nw-html-tmp
@ if [ -s "$*.nw-html-tmp" ]; then \
mv $*.nw-html-tmp $@; \
else \
echo "$@ not found in $<"; \
rm $*.nw-tmp; \
fi
clean:
- rm -f *.tex *.dvi *.aux *.toc *.log *.out *.html *.js
realclean: clean
- rm -f *.pdf
Issue here is may be you are trying to access the application in chrome and there is a known issue in chrome which cannot open file paths if you see the file path starts with
file:///instead offile://You can use any web server for that matter of fact just that you can access these path by a localhost url. try opening this same file in Firefox it should just work fine