14524e18 by yangjianbin

init

1 parent fed9f711
......@@ -14,43 +14,58 @@
<script src="https://cdn.bootcss.com/holder/2.9.4/holder.min.js"></script>
<script type="text/javascript" src="/resource/upload.js"></script>
<script>
(function($){
$.fn.serializeJson=function(){
var serializeObj={};
var array=this.serializeArray();
var str=this.serialize();
$(array).each(function(){
if(serializeObj[this.name]){
if($.isArray(serializeObj[this.name])){
(function ($) {
$.fn.serializeJson = function () {
var serializeObj = {};
var array = this.serializeArray();
var str = this.serialize();
$(array).each(function () {
if (serializeObj[this.name]) {
if ($.isArray(serializeObj[this.name])) {
serializeObj[this.name].push(this.value);
}else{
serializeObj[this.name]=[serializeObj[this.name],this.value];
} else {
serializeObj[this.name] = [serializeObj[this.name], this.value];
}
}else{
serializeObj[this.name]=this.value;
} else {
serializeObj[this.name] = this.value;
}
});
return serializeObj;
};
})(jQuery);
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值
if (r != null) return unescape(r[2]);
return null; //返回参数值
}
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
var hour = date.getHours();
var min = date.getMinutes();
var sec = date.getSeconds();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
if (hour >= 1 && hour <= 9) {
hour = "0" + hour;
}
if (min >= 1 && min <= 9) {
min = "0" + min;
}
if (sec >= 1 && sec <= 9) {
sec = "0" + sec;
}
var currentdate = year + seperator1 + month + seperator1 + strDate + ' ' + hour + ':' + min + ':' + sec;
return currentdate;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!