This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(isset($argv[1]) && $argv[1]==='-V'){ | |
die('Symfony version 2.7.8'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM stress_planlist WHERE id IN (SELECT max(id) FROM stress_planlist GROUP BY uid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function get_client_ip($type=0,$adv=false){ | |
$type=$type?1:0; | |
static $ip=null; | |
if($ip!==null){ | |
return $ip[$type]; | |
} | |
if($adv){ | |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ | |
$arr=explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); | |
$pos=array_search('unknown',$arr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//点击下拉加载 | |
var aaa=5; | |
var bbb=false; | |
//思考为什么必须要有一个event参数; | |
$('#loading').click(function(event,aaa,bbb){ | |
//思考为什么aaa和bbb都为undefined | |
console.log(event,aaa,bbb); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 逻辑跳转 | |
*/ | |
$('input[type="radio"]').change(function(){ | |
if($(this).attr('jumpto')>1){ | |
setTimeout(function(){ | |
console.log(this);//window | |
},100); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr=[1,2,3,4,5]; | |
console.log(Math.min.apply(null,arr));//1 | |
console.log(Math.max.apply(null,arr));//5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 data-name="zqq">Hello</h1> | |
<h2 data-name="zqq">World</h2> | |
<script type="text/javascript"> | |
console.log('======h1默认值======'); | |
console.log('data方法获取',$('h1').data('name'));//zqq | |
console.log('attr方法获取',$('h1').attr('data-name'));//zqq | |
console.log('======使用data()方法修改h1======'); | |
$('h1').data('name','yfx'); | |
console.log('data方法获取',$('h1').data('name'));//yfx | |
console.log('attr方法获取',$('h1').attr('data-name'));//zqq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*初始化一个富文本编辑器*/ | |
<a id="trigger-modal" class="btn btn-primary hidden" data-toggle="modal" href="#modal-editor">Trigger modal</a> | |
<div class="modal fade" id="modal-editor"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title">内容编辑</h4> | |
</div> | |
<div class="modal-body"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var editorHandler=function(){ | |
//$(this)即$('#wenjuan_remark'). | |
var $this=$(this); | |
$('#trigger-modal').trigger('click'); | |
$('#modal-editor').find('.action-calcel').click(function(){ | |
$('#modal-editor').find('.close').trigger('click'); | |
}); | |
$('#modal-editor').find('.action-ok').click(function(){ | |
$this.html(wenjuan_remark.$txt.html()); | |
$('#modal-editor').find('.close').trigger('click'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.btn-file { | |
position: relative; | |
overflow: hidden; | |
} | |
.btn-file input[type=file] { | |
position: absolute; | |
top: 0; | |
right: 0; | |
min-width: 100%; | |
min-height: 100%; |
NewerOlder