抱歉,这可能是一个完全的菜鸟问题
我从 github https://github.com/elfsternberg/The-Backbone-Store下载了一个主干示例应用程序,根据其自述文件,“必须安装在网络服务器下才能正常运行”。实际上,当我在 Chrome 中打开索引文件时,它只显示一个没有 javascript 功能的 html/css,并出现此错误
XMLHttpRequest cannot load file:///Users/me/Sites/backbonestore/data/items.json. Origin null is not allowed by Access-Control-Allow-Origin.
我认为这可能是因为 json 数据文件中的这些链接
"url": "http://www.amazon.com/Door-Religious-Knives/dp/B001FGW0UQ/?tag=quirkey-20"
该教程说我需要一个网络服务器,即使它不使用数据库。
当我不使用 Rails 时,有没有办法使用 webkit(我通常在 Rails 环境中工作)?如果这不是问题,那么你能解释一下我如何让它工作吗?
这个主干项目和我看过的其他项目之间的一个区别是它有一个 make 文件。我必须对此做些什么吗?
制作文件
.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