MVC中的Jquery终端不适合我

时间:2016-05-23 07:04:22

标签: javascript jquery html asp.net-mvc jquery-terminal

刚刚在cloud9中实现了我的项目http://terminal.jcubic.pl/#demo。它就像一个魅力,并做了它应有的一切。

项目= https://ide.c9.io/wigge/andreas-cv

网站= andreas-cv-wigge.c9users.io/kol.html

现在问题。 我想让它在我的视觉工作室的MVC项目中工作,截至目前,它没有。

MVC问题= http://gyazo.com/c24931d3479e6fe2df756e17af542f24

看起来终端没有得到它应该的脚本,我可以在终端写入但不删除并点击回车。

这里是我在MVC中的代码(我将在文件中提供js代码并在以后链接它们)jsfiddle.net/19o39bx1 /#& togetherjs = Ux8Mez1pOv

任何人都知道它可能是什么?

或者有人为我提供了更好的终端

3 个答案:

答案 0 :(得分:1)

默认asp.ne MVC项目中jQuery个文件会添加到默认页面中包含的捆绑广告中。我猜您还添加了jQuery文件附件。在jcubic's answer中,当加载了两个jquery文件时,再现了这种情况。

答案 1 :(得分:0)

当我在代码之后包含另一个jQuery时,我能够重现错误

<script src="js/jquery-1.8.0.js"></script>
<script src="js/jquery.mousewheel-min.js"></script>
<script src="js/jquery.terminal-src.js"></script>
<script>
jQuery(function($) {
    $('body').terminal(function(command, term) {
      term.echo(command);
    });
});
</script>
<script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>

检查你是否没有包含另一个jQuery(可能添加了MVC,检查结果页面的源代码)。

这是jQuery终端中可以修复的错误。

答案 2 :(得分:0)

似乎JQuery终端模拟器脚本在加载jQuery代码之前启动,以防止此尝试按此顺序实现您的脚本:

<script src="http://code.jquery.com/jquery-latest.min.js"></script>//download jquery
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/0.10.9/js/jquery.terminal.min.js"></script>//download jquery terminal
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/0.10.9/css/jquery.terminal.min.css" rel="stylesheet"/>// jquery terminal styles
相关问题