JavaScript
u010082526
这个作者很懒,什么都没留下…
展开
-
Js 日期加减
使用js实现某个日期(YYYY-MM-DD),添加某个天数后,得到新的日期(YYYY-MM-DD)使用js实现某个日期,添加某个天数后,得到新的日期var myDate = new Date();//当前日期var d = new Date(myDate);d.setDate(d.getDate() + 1)//当前日期加1天alert(d.Fo原创 2016-08-02 15:52:06 · 1395 阅读 · 0 评论 -
Failed to load resource: net::ERR_CONNECTION_REFUSED
页面上 导出excel表的功能出错 总是让 重新登录,还不能实现导出原创 2017-06-05 11:50:11 · 20204 阅读 · 1 评论 -
type="file"上传文档格式限制
选择 type="file" 的 元素:$(":file") if ($("input[name='qqfile']").length > 0) { alert(123); debugger; $(":file").attr("accept", ".doc*"); /原创 2017-08-01 15:11:14 · 627 阅读 · 0 评论 -
js赋值html
div赋值 for (var i = 0; i $("#WEATHERCONTENT" + i).html(result[i].WEATHERCONTENT); } for原创 2017-09-04 13:50:59 · 2832 阅读 · 0 评论 -
html日期加减
//显示某年某月某日 function getForecastTime(date) { date = new Date(date); var nDate = date.getFullYear() + "年"; nDate+=date.getMonth() + 1 + "月" + date.getDate() + "日";原创 2017-08-29 15:52:34 · 4005 阅读 · 0 评论 -
后台返回json,前台接收有问题
忘记写接收类型了dataType: "json", $.ajax({ url: "LoadLookData", data: { "dateTime": '@ViewBag.dateTime', "FORECASTPEOPLE": '@ViewBag.FORECASTPEOPLE' },//传递城市编号原创 2017-08-29 15:54:23 · 2299 阅读 · 0 评论 -
求js数组的最大值和最小值的四种方法
http://blog.csdn.net/wlangmood/article/details/59113275给定数组[54,65,43,21,12,34,45,58,97,24],求其最大值和最小值?定义数组var ary = [54,65,43,21,12,34,45,58,97,24];1、字符串拼接法利用toString和转载 2017-12-05 16:03:31 · 1176 阅读 · 0 评论 -
getfullyear is not a function
STime.getFullYear()报错改成new Date(STime).getFullYear()原创 2018-01-10 13:23:02 · 6294 阅读 · 0 评论 -
Cannot read property 'getAttribute' of null
//data: para,//重新传递参数data: { city: citycode, startTime: STime, endTime: ETime, Status: Status },//para,报错位置定位在myChart = ec.init(document.getElementById(container));//'main'改成container myCh转载 2018-01-10 15:58:33 · 16353 阅读 · 0 评论 -
$.fn.validatebox.methods[_44f] is not a function
$.fn.validatebox.methods[_44f] is not a functionvar ETime = $("#endTime").combobox('gimeValue');写错了var ETime = $("#endTime").combobox('getValue');原创 2018-01-10 13:48:25 · 3906 阅读 · 0 评论 -
悬而未决,求解答Cannot read property 'tabs' of undefined,...'options'
源代码查看页面正常,发布后放在服务器上显示的查询框重复,表格错乱,图表错乱【1】正常显示情况如下:【2】发布在服务器上显示异常原创 2018-07-03 08:57:23 · 1492 阅读 · 0 评论 -
js获取日期
https://blog.csdn.net/qq_39198420/article/details/75271053function getYestoday(date){ var yesterday_milliseconds=date.getTime()-1000*60*60*24; var yesterday = new Date(); ...转载 2018-07-04 14:59:00 · 117 阅读 · 0 评论 -
combotree下拉框多选
var dataJson = "["; dataJson += "{\"id\":\"all\",\"text\":\"全部\",\"checked\":true" + ",\"children\":[" dataJson += "{\"id\":\&q原创 2018-08-22 15:35:55 · 2782 阅读 · 0 评论 -
.net导入excel数据(上传文件到服务器,数据入库)
1.html页面<span id="btn_upload"></span>2.js代码 function AddRunningDiv() { $("<div class=\"datagrid-mask\"></div>").css({ display: "block", width:原创 2019-01-10 14:24:02 · 1917 阅读 · 0 评论 -
JavaScript prototype 使用介绍
http://www.cnblogs.com/socool-hu/p/5665270.html转载 2019-02-28 14:08:02 · 127 阅读 · 0 评论 -
js保留两位小数
(value*100).toFixed(2)+"%";原创 2017-02-24 16:59:08 · 303 阅读 · 0 评论 -
切换tab页
//切换Tab页 $('#tt').tabs({ border:false, onSelect:function(title){ alert(title+' is selected'); } });原创 2017-02-24 14:33:16 · 384 阅读 · 0 评论 -
延迟setTimeout(函数名,时间)
setTimeout(ab,4000);函数不能有参数原创 2017-02-20 15:29:58 · 935 阅读 · 0 评论 -
Unexpected token }
Unexpected token } 错误原因:json字符串报错[{"CITYCODE":"410100","MONITORTIME":"2016-08-02","FORECASTTIME":"2016-08-02","MINAQI":"","MAXAQI":"","PRIMARYPOLLUTION":"--",},{"CITYCODE":"410100","MONITORTIME":"原创 2016-08-02 16:34:24 · 9475 阅读 · 0 评论 -
Json字符串拼接
function MosaicData(json) { if (json.length return "[]"; var jsonData = "["; jsonData += "{"; jsonData += "\"REGION\":" + "\"" + json[0]["REGION"] + "\","; jsonData原创 2016-08-11 10:26:17 · 3835 阅读 · 0 评论 -
json行列转换
1.后台获取到的字段为 CITY = c.CITY, CITYCODE = CityCodeCommon.GetNewCityCode(c.CITY), oldCityCode = d.CITYCODE, REGION = CityCodeCommon.GetRegionByCity(c.CITY), MONITORTIME = d.MONITORTIME原创 2016-08-11 10:56:40 · 2946 阅读 · 0 评论 -
页面上获取登录用户名
1.@using Mapuni.Frame.Model2.@{ ViewBag.Title = "预报值班记录"; Layout = "~/Views/Shared/_LayoutCommJs.cshtml"; var userInfo = Session["UserBaseInfo"] as Mapuni.Frame.Mode原创 2016-09-13 14:18:00 · 5421 阅读 · 0 评论 -
Jquery 获取 radio选中值
+ "正 常会商发布" //去掉气象会商,变成3列。变成可选项 + "启动预 警会商"1.选中的时候,改变选项的值(onclick='GetRadio(this,1)') GetRadio()方法 //手动选中单选按钮 function GetRadio(obj,转载 2016-09-14 13:31:20 · 9376 阅读 · 0 评论 -
html引号里加引号
可以使用转移字符 \var Value = "...\"..."也可以用单引号来包含var Value = '..."...'或者把内容里的双引号换成单引号var Value = "...'..."一共三层引号,两种组合一起用console.info("-");输出内容如下 :-原创 2016-10-24 11:13:05 · 2281 阅读 · 0 评论 -
弹框页面
1>添加voc列Voc2>VocData方法(写上点击事件OpenData) function VocData(val, row, index) { return '-'; //',' + row.Monidate + } 去掉‘下划线’ a { TEXT-DECORATI原创 2016-10-20 14:52:16 · 287 阅读 · 0 评论 -
ajax异步请求
function LocationOnMap() { var objData; //参数 var index = $("#zhibiao").combobox("getValue");//污染指标 var year = $("#nianfen").combobox("getValue");//年份 //后...原创 2016-11-17 16:14:49 · 298 阅读 · 0 评论 -
combobox的值从主页面传递到子页面
1.主页面传递参数 url: '@Url.Action("WaterLoad")' + '?year=' + year + '&fanwei=' + fanwei,2.控制器里接收参数 public ActionResult WaterLoad(int year,string fanwei) { ViewBag.yea原创 2016-11-23 17:31:52 · 497 阅读 · 0 评论 -
向后台发送请求
1. ajax请求 $.ajax({ type: "post", url: "ChartData", dataType: "json", data: { section: section, index: index },//,year: year suc原创 2016-11-24 09:56:57 · 675 阅读 · 0 评论 -
查询按钮
查询//查询按钮 $("#btn").click(function () { loadtable(); });原创 2016-11-24 11:11:14 · 1250 阅读 · 0 评论 -
下拉框级联
一、功能描述:下拉框“模型”有两个下拉项:CMAQ、Wrf-Chem 选中“Wrf-Chem”,“区域”下拉框选中“吕梁及周边”并置灰,不可选;选中“CMAQ”,“区域”变可选。1>模型下拉框 模型:原创 2016-08-15 16:04:20 · 392 阅读 · 0 评论 -
下拉框级联(二)
html 范围: 地市/区域 省 京津冀 名称: js $(function () {原创 2016-12-27 09:39:56 · 326 阅读 · 0 评论 -
jquery 的attr
$("#test").attr("style", { "display": "none" });//改变属性为隐藏状态原创 2017-01-18 21:52:58 · 456 阅读 · 0 评论 -
jQuery与JavaScript与ajax三者的区别与联系
https://www.cnblogs.com/thomasbc/p/6650119.html简单总结:1、JS是一门前端语言。2、Ajax是一门技术,它提供了异步更新的机制,使用客户端与服务器间交换数据而非整个页面文档,实现页面的局部更新。3、jQuery是一个框架,它对JS进行了封装,使其更方便使用。jQuery使得JS与Ajax的使用更方便关系比喻:若把js比作...转载 2019-03-01 13:07:17 · 130 阅读 · 0 评论