我在这里有这个代码:
$("#order").validate({
rules: {
name: {
required: true
}
lastname: {
required: true
}
address: {
required: true
}
telephone: {
required: true
digits: true
}
email: {
required: true
email: true
}
}
submitHandler: function (form) {
debug = true;
$(form).ajaxSubmit();
$("#thanks").show(1000);
$("#datadiv").hide(500);
}
});
Run Code Online (Sandbox Code Playgroud)
并且它在此代码中的第4行的firebug上的属性列表"错误后抛出"missing}.而对于我的爱,我无法弄清楚为什么 - 因为我正在通过jquery文档做一切.
我正在使用Zurb基础,我正试图将嵌套列作为中心,但由于一个我无法理解的原因,它不是以它为中心.请问有人对此有所了解吗?!
<div class="container">
<div class="row">
<div class="12 columns">
<div class="row">
<div class="4 centered columns">
<h1>My Content</h1>
</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
谢谢!
我把头靠在墙上,希望得到一些帮助.所以..
最近,当我创建一个基础项目(或任何现有项目)时,我将导入所有基础:
@import "settings";
@import "foundation";
Run Code Online (Sandbox Code Playgroud)
但是,当我用罗盘编译scss时,它不会导入所有的基础.我最终得到:
../bower_components/foundation/scss/foundation/components/_visibility.scss */
../bower_components/foundation/scss/foundation/components/_offcanvas.scss */
../bower_components/foundation/scss/foundation/components/_icon-bar.scss */
Run Code Online (Sandbox Code Playgroud)
和我最后的app.css中的相关CSS,但没有其他导入.
我正在尝试使用ui.router,ocLazyLoad,Foundation和angular-foundation设置一个简单的angularjs应用程序.
该应用程序是一个多视图应用程序,它的组件使用ocLazyLoad延迟加载.我没有问题设置视图和相关的控制器.但是,在尝试显示Foundation警报时出现问题.当我尝试查看警报(route1)时,我收到空警报.下面的堆栈跟踪.
为什么angular应用警报指令两次?这里有一个plunker:http://goo.gl/lhtD0c
Error: [$compile:multidir] Multiple directives [alert, alert] asking for transclusion on:
<div class="alert-box" ng-class="(type || "")" ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">
http://errors.angularjs.org/1.2.22/$compile/multidir?p0=alert&p1=alert&p2=t…lerts%22%20type%3D%22alert.type%22%20close%3D%22closeAlert(%24index)%22%3E
at https://code.angularjs.org/1.2.22/angular.js:78:12
at assertNoDuplicate (https://code.angularjs.org/1.2.22/angular.js:6933:15)
at applyDirectivesToNode (https://code.angularjs.org/1.2.22/angular.js:6353:13)
at https://code.angularjs.org/1.2.22/angular.js:6858:37
at https://code.angularjs.org/1.2.22/angular.js:8091:11
at wrappedCallback (https://code.angularjs.org/1.2.22/angular.js:11546:81)
at wrappedCallback (https://code.angularjs.org/1.2.22/angular.js:11546:81)
at https://code.angularjs.org/1.2.22/angular.js:11632:26
at Scope.$eval (https://code.angularjs.org/1.2.22/angular.js:12658:28)
at Scope.$digest (https://code.angularjs.org/1.2.22/angular.js:12470:31)
Run Code Online (Sandbox Code Playgroud)
我索引的正文如下:
<body>
<div>
<a class="button" ui-sref="route1">Route 1</a>
<a class="button" ui-sref="route2">Route 2</a>
</div>
<div ui-view></div>
</body>
Run Code Online (Sandbox Code Playgroud)
与此页面关联的javascript是:
var …Run Code Online (Sandbox Code Playgroud) 我很高兴在Node中看到一个规则引擎,并在阅读Java文档的同时(尤其是:http ://docs.jboss.org/drools/release/6.1.0.Final/drools)在Java世界中查看了Drools。-docs / html_single / index.html#PHREAK)发现 Drools 6.0已经发展,现在使用PHREAK方法进行规则匹配。感兴趣的特定段落是:
RETE中每次成功的加入尝试都会产生一个元组(或令牌,或部分匹配),该元组将传播到子节点。因此,它被描述为面向元组的算法。对于到达的每个子节点,它将尝试与该节点的另一侧进行联接,再次,每次成功的联接尝试都将立即传播。这将产生下降递归效果。当节点网络从进入beta网络的点到所有可到达的叶节点上下左右波动时,对节点网络进行处理。
对于复杂的规则和超过一定限制的规则,以上引述说基于RETE的方法会浪费大量内存,因此它演变为PHREAK。
由于nools基于Rete算法,以上方法是否有效?是否进行过与PHREAK类似的优化?与Drools有任何比较吗?
由于一些奇怪,我坚持使用javascript到Jquery通过单击父li元素获得工作链接.基本上,点击任何地方李应采取用户到的链接一个是它的一个直接子.我有些远远似乎不起作用.代码:
<ul>
<li onclick="location.href='$(this).children('a:first').attr('href')';">
<a href="http://example.com/">link</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
谢谢!
我试图找到具有data-direction属性的标签.不知何故,它总是未定义的.我所试图做的就是值data-direction和data-cellId.有任何想法吗?
var row = $('<tr data-cellId="' + cell.fatherId + '" data-direction="' + cell.direction + '"/>');
var nameColumn = $('<td class="port-name-col" data-cellId="' + cell.fatherId + '">' +cell.value.name + '</td>');
var btnColumn = $('<td class="port-btn-col"><button type="button" title="Remove" class="btn btn-default btn-xs x-button-icon btn-delete-port"><span class="glyphicon glyphicon-trash"></span></button></td>');
row.append(nameColumn);
row.append(btnColumn);
Run Code Online (Sandbox Code Playgroud)
事件监听
$(document).off('click', '.btn-delete-port').on('click', '.btn-delete-port', function (event) {
var elem = event.target || event.srcElement;
//find tr element that has cellID attribute
var tr = $(elem).find("tr.data-cellId");
alert($(elem).parent().parent().html())
});
Run Code Online (Sandbox Code Playgroud) 我一整天都在苦苦思索,并试图完成这个问题中概述的步骤,但我无法发现问题.
我使用quicktree插件显示我的无序列表中的树.
如果我删除该行
<li><a href="#" title="Add a New Page" class="addnewpage-icon addnewpage" id="addnewpageid5">hello<a/>world</li>
Run Code Online (Sandbox Code Playgroud)
它有效,但包含它不会.
它在Chrome和FF中很好用.
<head>
<title>jQuery quickTree plugin example</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="http://www.prismstudio.co.uk/tutorials/quickTree/0.4/quickTree.css" />
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
jQuery.fn.quickTree = function() {
return this.each(function(){
//set variables
var $tree = $(this);
var $roots = $tree.find('li');
//set last list-item as variable (to allow different background graphic to be applied)
$tree.find('li:last-child').addClass('last');
//add class to allow styling
$tree.addClass('tree');
//hide all lists inside of …Run Code Online (Sandbox Code Playgroud) 我有一个模型扩展了具有特定规则的AR类.但是现在我需要在这个表中插入行,但是还有其他规则.我是否需要使用新规则创建其他模型,或者可以定义其他规则?
我对CActiveRecord.rules有疑问
public function rules(){
return array(
array('photo_path', 'required', 'on'=>'insert'),
array('photo_path', 'file', 'types'=>'jpg, gif, png', 'allowEmpty'=>true),
);
}
只有在创建模型时才需要Photo_path,在更新视图中它可以为空.
我不知道发生了什么,但一小时前它有效,但现在却没有.当我选择文件时,我得到'照片路径不能为空'
请帮忙 :)
javascript ×4
jquery ×4
html ×3
css ×2
php ×2
yii ×2
activerecord ×1
angularjs ×1
drools ×1
grid ×1
mongodb ×1
node.js ×1
onclick ×1
rule-engine ×1
sass ×1
validation ×1