『壹』 angulaerjs error.都有哪些判断
AngularJS内置的验证器
验证器
描述
required
正如前面所讨论的那样,这确保字段是必需的,字段标记为无效,直到填写。
ng-required
与required不同,这标志着字段也是必需的,ng-required指令允许我们基于控制器布尔条件标记输入字段为必需。
ng-minlength
该指令可以设定输入文本值的最小长度
ng-maxlength
该指令可以设定文本输入值的最小长度
ng-pattern
作为这个指令的一部分,文本输入的有效性可以针对指定的正则表达式模式进行检查。
type=”email”
文本输入内置电子邮件验证。
type=”number”
带有数量验证的文本输入。也可以有最小和最大值的附加属性。
type=”date”
如果浏览器支持,显示一个HTML日期选择器。否则,默认为一个文本输入。ng-model
绑定到日期对象。预计日期格式为yyyy-mm-dd(例如2009-10-24)。
type=”url”
带有输入验证的URL文本输入。
此外,我们可以编写自己的验证器,我们将在后面章节这个问题。
显示错误消息
我们能袭做用这些验证器做些什么呢?当然可用来检查表单的有效性,并相应地禁用保存或更新按钮。但是我们也要告诉用户错在哪里、如何丛禅雹修正。AngularJS提供两种方案来解决这个问题:
模型准渗帆确反映表单错误是什么,我们可以使用它来显示更友好的错误消息。
自动从每个字段添加和删除的CSS类允许我们的突出表单错误。
首先让我们看一看如何根据错误对象显示特定的错误消息,看下面的例子:
<html ng-app="notesApp">
<head><title>Notes App</title></head>
<body ng-controller="MainCtrl as ctrl">
<form ng-submit="ctrl.submit()" name="myForm">
<input type="text"
name="uname"
ng-model="ctrl.user.username"
required
ng-minlength="4">
<span ng-show="myForm.uname.$error.required">
This is a required field
</span>
<span ng-show="myForm.uname.$error.minlength">
Minimum length required is 4
</span>
<span ng-show="myForm.uname.$invalid">
This field is invalid
</span>
<input type="password"
name="pwd"
ng-model="ctrl.user.password"
required>
<span ng-show="myForm.pwd.$error.required">
This is a required field
</span>
<input type="submit"
value="Submit"
ng-disabled="myForm.$invalid">
</form>
<script src="http://riafan.com/libs/angular.js"></script>
<script type="text/javascript">
angular.mole('notesApp', [])
.controller('MainCtrl', [function() {
var self = this;
self.submit = function() {
console.log('User clicked submit with ', self.user);
};
}]);
</script>
</body>
</html>
『贰』 js如何根据 input value 设置 readOnly
不等于应该用 "!=", 不能用"<>",改过来以后,onchange时就可以了
不过必须是ongchange(就是加载完成后,在改动内容的时候才会改成只读的)
如果是想一打开页面就根据页面上的内容来控制只读的话,可以用输入框onchange事件来判断,放到body的onload判断就可以了,代码如下
<body onload="ChangeMode(document.getElementById('fankui1_c'));">
<input type='text' id='fankui1_c' size='50' maxlength='255' value='{FANKUI1_C}'>
</body>
另外,js方法已经把输入框当参数传过去了,里面就不用在document.getEle....了,直接用Obj就可以了
『叁』 js验证汉字,这段代码怎么会有错误呢
我不知道你裂帆的文本框是怎样子的,不过可以试下我的方法:
<script language="javascript">
function len(s) {
var l = 0;
var a = s.split("");
for (var i=0;i<a.length;i++) {
if (a[i].charCodeAt(0)<299) {
l++;
} else {
l+=2;
}
}
return l;
}
function isNLL()
{
if(document.form1.company.value==""){
alert("请输入公司名称!");
document.form1.company.focus();
return false;
}
var company = document.getElementById('company').value;
company=company.replace(/^\s+|\s+$/g,"");
if(len(company)<10)
{
alert("公司名称不能少于5个汉字");
document.getElementById('company').focus();
return false;
}
}
</script>
<form id="form1" name="form1" method="post" action="fankui.php" onsubmit="return isNLL();">
<tr>
<td height="35" align="right">公司名称:</td>
<td>肆团雹 </td>
<td>
<input name="company" type="text"或帆 class="input" id="company" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))" maxlength="20" /> <font color="#FF3300">请使用中文全称</font></td>
</tr>
<tr>
<td align="right"> </td>
<td> </td>
<td height="35"><input type="submit" name="Submit" value="提交" />
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="fid" value="2"/>
<input type="reset" name="Submit2" value="重置" /></td>
</tr>
</form>
『肆』 主板上JFAN和JSYS FAN各是什么意思
绝大多数主板上有2~3个风扇电源接口,主要是CPU风扇和机箱风扇。
JFAN一般是CPU的,也用CPU_FAN来标示。
JSYS FAN是系统风庆纯虚扇,也就是裤碧机箱的风扇,也用CHA_FAN来标示。
风扇电源接口有3针和4针誉燃的,3针可以显示转数,4针还可以控制转数。
『伍』 为什么fanvue注册
如果你在使用 Fanvue 时遇到注册问题,可能是以下几种原因:
1. 您输入的账号或密码不正确。请重新输宴手入正正祥穗确的账号和密码。
2. 你之前注册过多个账号,Fanvue 只能注册一个账号。
3. 网络举卜原因,您注册过程中可能会遇到网络中断,或者服务器无法访问等问题,请检查您的网络并重新尝试注册。
『陆』 欧曼车fan control按键怎么用
欧曼车fan control按键是风扇控制用作于调节风扇手动开关重型柴油车全面实施国六阶段已经快半年了,对于很多卡友关心的国六车价格要比国五车贵的情况,其实也不用过于担心。在春节来镇态临之前,全国各地有不少的经肆旅搜销商对牵引车进行岁末的降价促销。
欧曼车介绍
485马力 6X4 牵引车(国六)。动力方面,动力方面,搭载13升昆山三一动力D13C6-480E0发动机,最大输出485马力,符合国六排放,匹配12挡法士特12JSDX240TA变速箱,后桥速比3.7。
该车最大的特点是全系车型采用高强度轻量化新材料实现最大程度减重,包括使用了轻量化车架、轻量化转向系统以及摩擦焊工艺等设计,是一款强调合规多装的车型。
而且该车型在动力上依旧充沛,13L的三一道依茨发动机具有排量大扭矩大的特点,满足用户各种工况的动力需求,内饰设计和舒裂历适度都表现也都不错,特别适合拉散杂全国跑的散户。
『柒』 JS是哪位歌星
:::陈忠义
:::陈绮萱
英文名字:Justin
生 日: 1977年2月6日
籍 贯:辽宁
出 生 地:屏东
卜毕燃星 座:水瓶
血 型:O
身 高:188 cm
体 重:75 kg
个 性:独立, 爱好自由
家庭成员:爸、妈、一姐、一妹
喜爱的歌手:David Foster, 阪本龙一, Laura Pausini,
喜爱的音乐:Folk、R&B、电影配乐
型虚喜爱的电影类型:剧情片、科幻片、喜剧
平常的嗜好:看电影、旅行、享受美食
喜爱的动物:拉布拉多犬
讨厌的动物:蚊子
喜欢的颜色:白、黄、红
喜欢的服饰:休闲舒服的款式
喜爱的饰品:银饰
喜爱的食物:日本料理、意大利面、泰国菜
最想做的事:低调的音乐人
对自己的形容:务实的天真者
如何踏入演艺圈:
MTV新声卡位战创作组第一名1999年推出第一张国语大碟GoGo&MeMe「Say Forever」
英文名字:Sophia
生 日:1980年7月26日
籍 贯:辽宁
出 生 地:屏东
星 座:狮子
血 型:O
身 高:175 cm
体 重:58 kg
个 性:慢热
家庭成员:爸、妈、一兄、一姐 喜爱的歌手:Misia、中岛美嘉
喜爱的音乐:Jpop和其他一听就喜欢上的音乐
喜爱的电影类型:黑色喜剧、文艺爱情片
平常的嗜好:料理、阅读、看电影、上网
喜爱的动物:黄金金吉拉
讨厌的动物:青蛙
喜欢的颜色:桃红色
喜欢的服饰:有个性外加一点点女人味的款式
喜爱的饰品:自己的DIY
喜爱的食物:咖哩饭、拉面、妈妈的水饺
最想做的事:环游世界
对自己的形容:外冷内热
如何踏入演艺圈:
MTV新声卡位战创作组第一名1999年推出第一张国语大碟GoGo&MeMe「Say Forever」
陈忠义词曲作品列表(1999 ~ 2003)
作品明称 词/曲 演唱歌手 发行公司 发行年份
别管我 曲 蓝心湄 Sony 2000
Be Your Friend 词曲 丁小芹 友善的狗 2000
I DO 词曲 GoGo&Meme Sony 2000
eaven 曲 GoGo&Meme Sony 1999
我像你 曲 GoGo&Meme Sony 1999
说你会让我 曲 GoGo&Meme Sony 1999
大数蠢风吹 曲 GoGo&Meme Sony 1999
It’s Enough 曲 GoGo&Meme Sony 1999
fan茄咖啡 曲 GoGo&Meme Sony 1999
我还没准备好 曲 GoGo&Meme Sony 1999
莫 非 曲 4 IN LOVE BMG 2000
无所谓 曲 吴姵文 动能 2001
直至有你之后 曲 张家辉 英皇 2001
有你的天堂 词曲 许如芸 EMI 2001
C’est La Vie 曲 梁静茹 丰华 2001
为冬天写的诗 词曲 罗美玲 BMG 2002
除了你 曲 谷祖琳 华纳香港 2002
天生天养 曲 刘德华 加际娱乐 2002
他比我懂你吗 词曲 金海心 大陆索尼 2002
世界末日 词曲 高慧君 Universal 2002
也许有一天 曲 动力火车 华研 2002
镇守爱情 曲 动力火车 华研 2002
A Better Day 曲 刘德华 加际娱乐 2002
喜欢你 词曲 可米小子 Sony 2002
蔷薇的眼泪 词曲 刘德华 未定 未定
凌晨三点钟 词曲 张智成 华研 2003
请问爱情 曲 张智成 华研 2003
The Moment 词曲 孙燕姿 华纳 2003
换日线 词曲 张智成 华研 2003
伤心换日线 曲 张智成 华研 2003
青春纪念册 词 可米小子 Sony 2003
Hold Me Close 词曲 可米小子 Sony 2003
原谅你 词曲 雅 立 丰华 2003
你和我和他之间 词曲 窦智孔 戴爱玲 滚石唱片 2004
白鹤 词曲 JS 华研 2004
爱让我们寂寞 词曲 JS 华研 2004
So Far Away 词曲 张智成 Sophia 华研 2004
学著 曲 蜜雪薇琪 福茂 2004
想要爱你 曲 言承旭 新力 2004
『捌』 如何实现在html+css做的风扇,实现做出js风扇点击按钮有转动效果求代
<!doctypehtml>
<html>
<head>
<metacharset="utf-8">
<title></title>
<style>
@keyframesleafRotate{
0%{
transform:rotate(0deg);
}
100%{
transform:rotate(360deg);
}
}
#fan{
width:230px;
position:absolute;
z-index:10;
margin:auto;
left:0;
right:0;
top:150px
}
#fan.header{
width:230px;
height:230px;
position:absolute;
left:-15px;
top:-15px;
background:#42c7ea;
border-radius:50%;
z-index:10;
border:2pxsolid#0e6873;
}
#fan.mask{
width:200px;
height:200px;
border-radius:50%;
border:2pxsolid#0e6873;
position:relative;
background:#e4ecef;
z-index:11;
}
#fan.mask.logo{
border:2pxsolid#0e6873;
border-radius:50%;
position:absolute;
width:80px;
岁纯带height:90px;
text-align:center;
line-height:90px;
color:#0e6873;
font-size:14px;
top:53px;
left:58px;
background:#42c7ea;
z-index:3;
}
#fan.mask.line{
width:200px;
height:2px;
background:#3c8a93;
position:absolute;
top:99px;
z-index:2;
}
#fan.mask.line_1{
width:200px;
height:2px;
乎芦background:#3c8a93;
position:absolute;
top:99px;
z-index:2;
}
#fan.mask.line_2{
width:200px;
height:2px;
background:#3c8a93;
position:absolute;
top:99px;
z-index:2;
transform:rotate(30deg);
}
#fan.mask.line_3{
width:200px;
height:2px;
background:#3c8a93;
position:absolute;
top:99px;
z-index:2;
transform:rotate(60deg);
}
#fan.mask.line_4{
width:200px;
height:2px;
background:#3c8a93;
position:absolute;
裤神top:99px;
z-index:2;
transform:rotate(90deg);
}
#fan.mask.line_5{
width:200px;
height:2px;
background:#3c8a93;
position:absolute;
top:99px;
z-index:2;
transform:rotate(120deg);
}
#fan.mask.line_6{
width:200px;
height:2px;
background:#3c8a93;
position:absolute;
top:99px;
z-index:2;
transform:rotate(150deg);
}
#fan.mask.leafs{
z-index:1;
position:absolute;
animation:leafRotate0sinfinitelinear;
transform-origin:centercenter;
width:200px;
height:200px;
}
#fan.mask.leafs.leaf{
width:72px;
height:60px;
border-radius:20%40%;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
left:100px;
top:100px;
transform-origin:lefttop;
}
#fan.mask.leafs.leaf_1{
width:72px;
height:60px;
border-radius:20%40%;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
left:100px;
top:100px;
transform-origin:lefttop;
}
#fan.mask.leafs.leaf_2{
width:72px;
height:60px;
border-radius:20%40%;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
left:100px;
top:100px;
transform-origin:lefttop;
transform:rotate(120deg);
}
#fan.mask.leafs.leaf_3{
width:72px;
height:60px;
border-radius:20%40%;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
left:100px;
top:100px;
transform-origin:lefttop;
transform:rotate(240deg);
}
#fan.neck{
width:40px;
height:70px;
border:2pxsolid#0e6873;
background:#42c7ea;
position:absolute;
left:80px;
z-index:9;
border-radius:005%5%;
}
#fan.neck_footer{
width:50px;
height:20px;
border:2pxsolid#0e6873;
background:#77e1f1;
position:absolute;
top:263px;
left:75px;
border-radius:50%;
z-index:8;
}
#fan.bottom{
width:200px;
height:80px;
border-radius:50%;
border:2pxsolid#0e6873;
background:#42c7ea;
position:absolute;
top:250px;
left:0px;
z-index:7;
}
#fan.bottom_footer{
width:20px;
height:20px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:40%;
z-index:6;
top:310px;
}
#fan.bottom_footer_1{
width:20px;
height:20px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:40%;
z-index:6;
top:310px;
left:20px;
}
#fan.bottom_footer_2{
width:20px;
height:20px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:40%;
z-index:6;
top:310px;
left:160px;
}
#fan.switch{
position:absolute;
width:24px;
height:24px;
top:296px;
z-index:13;
opacity:0;
cursor:pointer;
}
#fan.switch_btn{
display:inline-block;
text-align:center;
width:18px;
height:20px;
line-height:20px;
font-size:12px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:50%;
color:#0e6873;
cursor:pointer;
top:296px;
z-index:12;
transform:rotateX(45deg);
}
#fan.switch_0{
position:absolute;
width:24px;
height:24px;
top:296px;
z-index:13;
opacity:0;
cursor:pointer;
left:50px;
}
#fan.switch_0:checked+div+input+div+input+div+input+div+.mask.leafs{
animation-play-state:paused;
}
#fan.switch_1{
position:absolute;
width:24px;
height:24px;
top:296px;
z-index:13;
opacity:0;
cursor:pointer;
left:75px;
}
#fan.switch_1:checked+div{
background:#a9af27;
color:#0e6873;
}
#fan.switch_1:checked+div+input+div+input+div+.mask.leafs{
animation-ration:0.7s;
}
#fan.switch_2{
position:absolute;
width:24px;
height:24px;
top:296px;
z-index:13;
opacity:0;
cursor:pointer;
left:100px;
}
#fan.switch_2:checked+div{
background:#a9af27;
color:#0e6873;
}
#fan.switch_2:checked+div+input+div+.mask.leafs{
animation-ration:0.4s;
}
#fan.switch_3{
position:absolute;
width:24px;
height:24px;
top:296px;
z-index:13;
opacity:0;
cursor:pointer;
left:125px;
}
#fan.switch_3:checked+div{
background:#a9af27;
color:#0e6873;
}
#fan.switch_3:checked+div+.mask.leafs{
animation-ration:0.3s;
}
#fan.switch_btn_0{
display:inline-block;
text-align:center;
width:18px;
height:20px;
line-height:20px;
font-size:12px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:50%;
color:#0e6873;
cursor:pointer;
top:296px;
z-index:12;
transform:rotateX(45deg);
left:50px;
}
#fan.switch_btn_1{
display:inline-block;
text-align:center;
width:18px;
height:20px;
line-height:20px;
font-size:12px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:50%;
color:#0e6873;
cursor:pointer;
top:296px;
z-index:12;
transform:rotateX(45deg);
left:75px;
}
#fan.switch_btn_2{
display:inline-block;
text-align:center;
width:18px;
height:20px;
line-height:20px;
font-size:12px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:50%;
color:#0e6873;
cursor:pointer;
top:296px;
z-index:12;
transform:rotateX(45deg);
left:100px;
}
#fan.switch_btn_3{
display:inline-block;
text-align:center;
width:18px;
height:20px;
line-height:20px;
font-size:12px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:50%;
color:#0e6873;
cursor:pointer;
top:296px;
z-index:12;
transform:rotateX(45deg);
left:125px;
}
#fan.on_off{
position:absolute;
width:40px;
height:20px;
top:296px;
z-index:13;
left:80px;
opacity:0;
cursor:pointer;
}
#fan.on_off:checked+div{
box-shadow:none;
}
#fan.on_off:checked+div+.mask.leafs{
animation:leafRotate2s1ease-out;
animation-delay:1s;
animation-fill-mode:forwards;
}
#fan.on_off_btn{
display:inline-block;
text-align:center;
width:40px;
height:20px;
line-height:20px;
font-size:12px;
background:#bdcc2b;
border:2pxsolid#0e6873;
position:absolute;
border-radius:50%;
color:#0e6873;
cursor:pointer;
top:296px;
z-index:12;
left:80px;
box-shadow:inset2px2px6px#555;
}
</style>
</head>
<body>
<divid="fan">
<inputtype="radio"name="switch"class="switch_0">
<divclass="switch_btn_0">0</div>
<inputtype="radio"checked=""name="switch"class="switch_1">
<divclass="switch_btn_1">1</div>
<inputtype="radio"name="switch"class="switch_2">
<divclass="switch_btn_2">2</div>
<inputtype="radio"name="switch"class="switch_3">
<divclass="switch_btn_3">3</div>
<divclass="mask">
<divclass="logo">风扇</div>
<divclass="line_1"></div>
<divclass="line_2"></div>
<divclass="line_3"></div>
<divclass="line_4"></div>
<divclass="line_5"></div>
<divclass="line_6"></div>
<divclass="leafs">
<divclass="leaf_1"></div>
<divclass="leaf_2"></div>
<divclass="leaf_3"></div>
</div>
</div>
<divclass="header"></div>
<divclass="neck"></div>
<divclass="neck_footer"></div>
<divclass="bottom"></div>
<divclass="bottom_footer_1"></div>
<divclass="bottom_footer_2"></div>
</div>
</body>
</html>
『玖』 华硕P5QLSE在BIOS里边屏蔽CPU风扇的检测
华硕P5QLSE主板上只有一个CPU风扇插座(紧挨着该插座的旁边还有一个“PowerFan”插座但是被厂家省略了没有焊上插针),只要你把CPU风扇插到了“CPUFan”插针上,那就插对了。
过去一直没事现在忽然老出cpufanerror的提示,那可能是CPU风扇本身坏了,或者是主板上CPU风扇电路中返歼宏检测转速的电路坏了。你可以先换一个风扇(不是整个连风扇的散热器,而是仅仅换一个风扇)看看。这种风扇本身并不值钱,一二十元钱左右就能买到。最好不要从BIOS里面改动CPU风扇的有关设置,否则容易出现CPU风扇改纯不转也不报警的情况,在炎热的漏册夏季里对CPU的安全不利。
『拾』 JSON PHP中,Json字符串反序列化成对象/数组的方法
如下所示:
<?php
//php反编码解析json信息
//json_decode(json字符串);
$city
=
array('shandong'=>'jinan','henan'=>'zhengzhou','hebei'=>'shijiazhuang');
$jn_city
=
json_encode($city);
//反编码json
$fan_city
=
json_decode($jn_city,false);//第二个参数false则返回object类型,false可以默认不写
var_mp($fan_city);//object(stdClass)#1
(3)
{
["shandong"]=>
string(5)
"jinan"
["henan"]=>
string(9)
"zhengzhou"
["hebei"]=>
string(12)
"shijiazhuang"
}
echo
"<br
/>";
$fan_city
=
json_decode($jn_city,true);//第二个参数true则返回array类型
var_mp($fan_city);//array(3)
{
["shandong"]=>
string(5)
"jinan"
["henan"]=>
string(9)
"zhengzhou"
["hebei"]=>
string(12)
"shijiazhuang"
}
手动写的JSON字符串一定要用单引号才能成功反序列化成对象/数组:
<?php
//json信息反编码
//不同php版本,对“纯json字符串”解析存在问题
//使用双引号定义的json字符串反编码操作变为null
//$jn
=
"{'name':'tom','age':'20','addr':'beijing'}";
//$fan_jn
=
json_decode($jn,true);
//var_mp($fan_jn);//NULL
//使用单引号定义的json字符串反编码操作会成功
$jn
=
'{"name":"tom","age":"20","addr":"beijing"}';
$fan_jn
=
json_decode($jn,true);
var_mp($fan_jn);
以上这篇JSON
PHP中,Json字符串反序列化成对象/数组的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:C#实现JSON字符串序列化与反序列化的方法jquery序列化form表单使用ajax提交后处理返回的json数据js解析与序列化json数据(二)序列化探讨Json序列化和反序列化方法解析Jquery
组合form元素为json格式,asp.net反序列化jQuery实现form表单元素序列化为json对象的方法浅析JSON序列化与反序列化JS实现json的序列化和反序列化功能示例js解析与序列化json数据(三)json的解析探讨JavaScript实现的反序列化json字符串操作示例