判断JSON返回的对象中的firstName这一列的值是...

yle type="text/css"> #TagsSwitcher{color:#A00;} #RecTags#MyTags{margin:5px 0;} #RecTags a.tag{line-height:24px;} #favor_form{width:200px;} #favor_form p:first-child{margin:5px 0;} #favor_form p {color:#666;} #favor_form form{min-height:85px;width:200px;} #favor_form form ._favor_input{display:block;margin:2px 0;width:199px;} #favor_form form ._favor_button{float:left;padding:2px 5px;} .favor_ok {text-align:center;font-size:10.5pt;width:199px;height:60px;margin-top:10px;} #TagsSwitcher{cursor:pointer;float:right;margin-top:10px;} #MyTags{display:none;width:199px;} #MyTags a.tag {float:left; background-color: #E0EAF1;border-bottom: 1px solid #3E6D8E;border-right: 1px solid #7F9FB6;color: #3E6D8E;font-size: 8pt;line-height: 16px;margin: 2px 2px 2px 0;padding: 2px 4px;text-decoration: none;white-space: nowrap;} #MyTags a.tag:hover{background-color: #3E6D8E;color: #FFF;} #toolbar_wrapper{padding:10px 0 5px 0;} .toolbar{height:33px;margin:0;padding:0;vertical-align: middle;border:1px solid #CCC;-moz-box-shadow: 0 1px 3px rgba(1981981980.5);-webkit-box-shadow: 0 1px 3px rgba(1981981980.5);box-shadow: 0 1px 3px rgba(1981981980.5);} .toolbar a{text-decoration:none;color:black;} .share{float:left;margin:0;padding:3px 0 0 0;line-height:25px;width:280px;} .share_sina{float:left;background:url(/img/toolbar.gif) -1px -278px no-repeat;padding-left:25px;padding-right:5px;margin-left:3px;} .share_qq{float:left;background:url(/img/toolbar.gif) -1px -316px no-repeat;padding-left:25px;padding-right:5px;} #share_weixin {float:left;background:url('/img/weixin.gif') 5px 4px no-repeat;padding-left:25px; cursor:pointer;} .options{float:right;margin:3px 5px 0 5px;padding:0;height:30px;line-height:25px;} .tool_title {float:left;text-align:center;vertical-align:middle;margin:0 0 0 5px;line-height:33px;} .options .tool_title{line-height:30px;} .favorite{float:left;} .soft_collect{background: url(/img/toolbar.gif) 0 -1px no-repeat; cursor: pointer;padding-left:20px;} .soft_collected{background: url(/img/toolbar.gif) 1px -28px no-repeat;} .soft_collect_count{font-size:12pt;font-family: Arial;color:#8B0000;margin:0 10px 0 10px;} .soft_collect_count:hover {color:red;} .soft_used{float:right;margin:0 0 0 20px;padding:0;position: relative;} .soft_used_button{z-index: 1; position: relative; cursor: pointer;margin-left:10px;} .arrow_holder{background: url(/img/toolbar.gif) -1px -350px no-repeat;} a.soft_used_button_n{} a.soft_used_button_y{color:#40AA53;font-weight:bold;} .soft_used_level{ z-index: 99; position: absolute; top: 28px;left: 0; width: 80px; background-color: #f9f9f9; border: 1px solid #ccc;} .soft_used_level li{ line-height: 34px; padding-left: 30px;background: url(/img/toolbar.gif) 3px -390px no-repeat; cursor: pointer;} .soft_used_level li.choice{ background-color: #e9e9e9; background-position: 3px -418px} .soft_used_level li.level{ background-position: 3px -418px} .options .report{float:left;background: url(/img/toolbar.gif) 0 -113px no-repeat;padding:0 10px 0 15px;border-top:1px solid #CCC;border-bottom:1px solid #CCC;border-right:1px solid #CCC;} .options .vote{float:right;width:120px;margin:0 0 0 20px;padding:0 5px;border:1px solid #CCC;text-align:center;vertical-align:middle;} .options .vote-up-on{float:left;background: url(/img/toolbar.gif) 0 -160px no-repeat;padding-left:15px;} .options .vote-up-off{float:left;background: url(/img/toolbar.gif) 0 -137px no-repeat;padding-left:15px;} .options .vote-down-on{float:right;background: url(/img/toolbar.gif) 0 -209px no-repeat;padding-left:15px;} .options .vote-down-off{float:right;background: url(/img/toolbar.gif) 0 -184px no-repeat;padding-left:15px;} .options .vote-count-post{font-size:12pt;font-family: Arial;color: #8B0000;text-align: center;vertical-align:middle;margin:0 5px;} .options .news_deliver{float:left;background: url(/img/toolbar.gif) 3px -243px no-repeat;padding:0 10px 0 24px;border-top:1px solid #CCC;border-bottom:1px solid #CCC;border-right:1px solid #CCC;} #p_used_count{cursor:pointer;} yle> ript type='text/javascript'> $(document).ready(function(){ $.ajax({ url:"/action/favorite/attentionUsersCount" type:"get" data:"id="+58788+"&type="+5 success:function(msg){ $("#p_favor_count").html("+"+msg); } }); $('#favor_trigger').click(function(){ add_to_favor(587885); }); }); var favor_ok = "

已成功添加到收藏夹

我的收藏夹 | 关闭

"; function delete_favor(obi_id obj_type){ if(!confirm('确定取消收藏?')) return; $.post("/action/favorite/cancel?type="+obj_type+"&id="+obi_id+"&user=${g_user.id}"function(html){ $('#favor_trigger').removeClass('soft_collected'); $('#favor_trigger').attr('title''添加到收藏'); $('#p_favor_count').html('+'+html); $('#favor_trigger').unbind('click'); $('#favor_trigger').click(function(){add_to_favor(587885);}); }); } function add_to_favor(obj_id obj_type){ if(confirm('必须登录后才能收藏,是否现在登录?')){ location.href="https://www.oschina.net/home/login?goto_page="+encodeURIComponent(location.href); } } function close_favor(elem_id){ $('#favor_trigger').poshytip('destroy'); } function setTag(tv){ var t = $("._favor_input"); var value = t.val(); var tags = value.replace(/,/ig'').split(''); var exist = false; value = $.map(tagsfunction(vi){ if($.trim(tv) == $.trim(v)){ exist = true; return undefined; } return v; }).join(''); if(exist){ t.val(value); return; } if(value!="") t.val(value+""+tv); else t.val(tv) }
ript>
分享到: 
判断JSON返回的对象中的firstName这一列的值是否包含指定的字符,如果包含指定字符则返回true否则返回false
标签: <无>
yle> .CodeEntity .code_pieces ul.piece_anchor{width:25px;position:absolute;top:25px;left:-30px;z-index:1000;} .CodeEntity .code_pieces ul.piece_anchor li{width:25px;background: #efe;margin-bottom:2px;} .CodeEntity .code_pieces ul.piece_anchor li{border-left:3px #40AA63 solid;border-right:3px #efe solid;} .CodeEntity .code_pieces ul.piece_anchor li:hover{border-right:3px #40AA63 solid;border-left:3px #efe solid;} .CodeEntity .code_pieces ul.piece_anchor li a{color: #333;padding: 3px 10px;} .CodeEntity .code_pieces .jump_to_code{visibility:hidden;position:relative;} .CodeEntity .code_pieces .code_piece:hover .jump_to_code{visibility:visible;} .CodeEntity .code_pieces .code_piece:hover .jump_to_code a{text-decoration:none;} .CodeEntity .code_pieces h2 i{float:right;font-style:normal;font-weight:normal;} .CodeEntity .code_pieces h2 i a{font-size:9pt;background: #FFFFFF;color:#00A;padding: 2px 5px;text-decoration:none;} yle>

代码片段(1) [全屏查看所有代码]

1. [代码][其他]代码     跳至 [1] [全屏预览]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>a.html</title> <script type="text/javascript"> 	function al(){ 		var txt=document.getElementById("aa").value; 		var reg=/^\d{120}:[A-Za-z0-9\s\u0800-\u9FA5\@\#\!\-\+\$\^\&\*\_\=]{130}$/; 		if(reg.test(txt)){ 				alert("匹配"); 		}else { 				alert("不匹配"); 			  } 		var flag=test(); 		alert(flag); 		} 			 			 	function test(){ 		var tt=false;	 		 		var employees = [ 				{ "firstName":"Bill"  "lastName":"Gates" } 				{ "firstName":"George"  "lastName":"Bush" } 				{ "firstName":"Thomas"  "lastName": "Carter" } 				]; 		 		var name="George"; 		for(var i=0;i<employees.length;i++){ 			if(name==employees[i].firstName){ 				tt= true; 				return tt; 			} 		} 		tt= false; 		return tt; 		 	} 		 </script>  <meta http-equiv="keywords" content="keyword1keyword2keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> 	<form> 		<input id="aa" value="123: に111111111111111111っぽん收拾收拾啊啊1" onclick="al()" /> 	</form> </body> </html> 
yle type='text/css'> .code_report{float:right} .code_report div{ float: left; margin-left: 5px; background: url("/img/ask-icon.gif") no-repeat; padding: 6px 0 6px 15px; padding-left: 15px; height: 16px;} .code_report a{ background: url("/img/ask-icon.gif") 0 -160px no-repeat;padding-left: 20px; line-height: 15px;height: 16px; color: #333; text-decoration: none; display:inline-block; zoom:1; vertical-align: middle;} .code_report em{ height: 28px; line-height:28px; width: 14px; display: inline-block; float: left; background: url("/img/ask-icon.gif") top right;} yle>

yle='margin:10px 0 0 0;font-weight:bold;color:#A00;text-decoration:none;'>开源中国-程序员在线工具:Git代码托管 yle="text-decoration:none;">API文档大全(120+) yle="text-decoration:none;" target='_blank'>JS在线编辑演示 yle="text-decoration:none;" target='_blank'>二维码 yle="text-decoration:none;" target='_blank'>更多»

yle='margin:0;'>
回到顶部   回到评论列表
分享这篇文章:
收藏+0