问题标签 [javascriptmvc]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1521 浏览

javascript - 在 JavascriptMVC 中调用控制器

我有两个控制器,init

并且tabs

如何在init中调用标签?

0 投票
3 回答
4065 浏览

javascript - Server-side vs. Client-side (AJAX) Loading

I was wondering what is considered best practice. Let's say I have a dropdown select widget. Should it be preloaded with content when the page is served up from the server or once it is loaded, should an AJAX request be made to retrieve the contents and then populate it?

I kinda like the idea of loading it empty and issuing an AJAX call to retrieve the contents. But is that going to result in slower page loading times. Especially if the page has several widgets that need to be loaded with content from the server?

Does it matter on the amount of content being loaded?

For the dropdown example, I meant the options in the dropdown. So if I had a dropdown of employees to choose, from I am referring to that list of employees. Do I load an empty dropdown and on init of the controller have it retrieve the employees and populate the dropdown?

But then I think about a datagrid of let's say 200 rows of emplyees and some employee data that is stored in a database. Do I load the page and when the page loads have a controller whose init function retrieves the dataset of employees and populates and displays the datagrid?

Or when the page is served up from the server does it retrieve the dataset on the server-side where it also creates the datagrid and it gets loaded then. This is the programming world that I am used to having done mostly PHP, JSP and ASP stuff in the past. Only using JavaScript for some cool page effects, etc.

But I seem to like the idea of once the page is loaded (or being loaded), make AJAX requests to retrieve the data needed to populate the widgets/content on the current screen. I am just concerned that the loading of page might seem clunky or slow since I am now making more requests to the server to paint the page. The initial request for the page, and then a request for each dataset needed to populate a widget.

0 投票
4 回答
12435 浏览

backbone.js - 离线使用 Backbone.js

我正在评估 Backbone.js 以在我的 Web 应用程序中保持数据和 UI 同步。然而,Backbone 的大部分价值似乎在于它对 RESTful 接口的使用。虽然我将来可能会添加服务器端备份,但我的主要用例涉及使用 HTML5 本地存储离线存储所有数据。

对于这样的用例,Backbone 是否矫枉过正?如果是这样,是否有更好的解决方案,仅专注于在数据更改时更新 UI,反之亦然?(我也在研究 Knockout 和 Javascript MVC。)

编辑:我现在也在研究Angular.jsjQuery Data Link

0 投票
1 回答
566 浏览

asp.net-mvc - 带有asp.net mvc的javascriptmvc文件夹结构

在我看来,将 javascriptmvc 安装到 asp.net mvc 中的第一个最大障碍是文件夹结构。有没有人调整 asp.net mvc 文件夹结构来提供来自 javascriptmvc 期望的文件夹结构的内容文件?

0 投票
2 回答
10589 浏览

javascript - BackboneJS vs JavaScriptMVC vs KnockoutJS

我想为复杂的 Web 应用程序使用 JavaScript 框架。我一直在研究 Backbone.js、knockout.js 和 JavaScriptMVC。作为客户端 JavaScript 重度网络应用程序的新手,我不确定该选择哪一个。每个人都有完全不同的方法来分离关注点。模型/视图/控制器与模型/视图/视图模型与模型/视图/集合。

你们有什么感想?决定因素是什么?哪一个最容易上手?你的经历是怎样的?

0 投票
1 回答
640 浏览

ruby-on-rails - javascriptMVC 和 Rails 文件夹结构

我最近开始开发一个需要大量脚本客户端的应用程序,并且一直在考虑将 Rails 与 JavascriptMVC 集成。发现 JupiterJS 的人也在做同样的事情,这很好,但是,

我一直在谷歌上搜索,在 javascriptMVC 的论坛上,我仍然找不到明确的答案 - 我应该将所有 javascriptMVC 文件夹和文件放在 Rails 文件结构中的哪里?

我最初打算将所有新的 javascriptMVC 文件放在 /public/javascripts/ 中 - 但我有点担心它可能带来的安全问题 - 所有测试文件、文档和脚本都将可供全世界访问。另外,javascriptMVC中的说明说:

“专业提示:将这些文件解压缩到您的应用程序文件夹结构中尽可能高的位置(即不要将它们放在公共目录中的 javascriptmvc 文件夹下)。”

所以现在我不确定。关于一个好的 rails + javascriptMVC 文件夹结构的任何想法,我是否需要向 Rails 环境添加任何新路径以允许它在 public/ 之外工作?

0 投票
1 回答
3093 浏览

command-line - Mac终端错误'-bash:./js:权限被拒绝'

我正在学习 JavascriptMVC,我在终端中运行以下命令,我从这里得到:

我是命令行新手。我所有的谷歌搜索都一无所获。我想我缺少某种配置或什么?

0 投票
1 回答
430 浏览

javascript - MVC 框架概念创建本地数据库

是否可以使用 javascript + html5 中的 MVC 框架概念创建本地数据库

问候

拉文德兰

0 投票
1 回答
237 浏览

javascriptmvc - javascriptmvc 根级 url -> 问题

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

0 投票
1 回答
738 浏览

ruby-on-rails - Rails 3 - 如何将身份验证令牌传递给客户端框架,如 Sproutcore

我正在研究开发一个带有 Rails 3 后端的 Sproutcore 客户端 web 应用程序。我设想的问题之一是必须通过身份验证令牌以及 Sproutcore 和 Rails 之间的通信。

CSRF 令牌何时重新生成?它是基于每个会话的吗?是否可以禁用登录请求的真实性检查,然后从登录中传回身份验证令牌并将其存储在客户端以供将来请求?