javascriptmvc 根级 url ->问题

发布于 2024-11-02 09:52:55 字数 367 浏览 7 评论 0原文

我是第一次探索 JMVC。我已经设置了我的食谱应用程序,如果我转到 http://localhost/jmvc/cookbook。 (我将 cookbook.html 重命名为 index.html。)但是,如果我创建一个域指针,以便我可以转到 http:// /dev.cookbook/ 我看到主页,但窃取脚本未加载。我想这是有道理的,因为他们正在寻找“../steal/{stuff}”,并且该路径对于该设置无效。那么解决方法是什么呢?当然,我不必为我的所有 JMVC 项目都有一个容器文件夹。

I'm exploring JMVC for the first time. I have my cookbook app set up and it seems to be working if I go to http://localhost/jmvc/cookbook. (I renamed cookbook.html to index.html.) However, if I make a domain pointer so that I can just go to http://dev.cookbook/ I see the main page, but the steal scripts don't load. I guess that makes sense, since they're looking for '../steal/{stuff}', and that path is invalid with that set-up. So what's the workaround? Surely I don't have to have a container folder for all of my JMVC projects.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给不了的爱 2024-11-09 09:52:55

在 jmvc 论坛上得到了答案: http://forum.javascriptmvc.com /topic/root-level-url-problems#32525000000404011

基本上,您构建了一个如下结构:

webroot (jmvc)/
   index.html
   myapp/
   steal/
   jquery/
   {other parts of jmvc}

在index.html中,您有一行类似:

<script type='text/javascript' src='steal/steal.js?myapp,development'></script>

got an answer on the jmvc forums: http://forum.javascriptmvc.com/topic/root-level-url-problems#32525000000404011

basically, you build a structure like:

webroot (jmvc)/
   index.html
   myapp/
   steal/
   jquery/
   {other parts of jmvc}

in index.html, you have a line like:

<script type='text/javascript' src='steal/steal.js?myapp,development'></script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文