1、No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access.
OtherDrugRecordForm.html:1 Uncaught (in promise)
报错:是因为跨域了
2、数组不能相等,要先tostring()
3、a标签整页刷新,span标签不会换行
4、“路径?参数名=”+参数
5、onclick="return check()" 点击事件方法名前面要加return,否则return false;无法执行
6、toString().trim() 转成string类型,并且去掉前后空白
7、Format():字符串格式化函数.使用很简单.如 string a=string.Format("你的姓名:{0},年龄:{1}","张三",16);
得到的a 就是 "你的姓名:张三,年龄16"
8、$("#createrId option[value='" + data.Creater + "']").attr('selected', true);//jquery实现下拉列表选中
$("select[name='createOption']").val(data.Creater);//js下拉列表选中
9、formatDatetime()
时间格式转换显示年月日
10、session:
Session["LoginId"] = loginId;
string loginid = (string)Session["LoginId"];
11、js委托:
$("#id").on("click", function() {
})
delegate() 方法也是
12、siblings()//使用siblings获取被点击元素之外的同级元素
$(".dingling").siblings().hide();
public HomeController()
{
_hdp = new HDPModel();
}
14、无法将int 隐式转换为int,是否存在一个显示转换
可以为空:.value
15、实体需要序列化,大括号里面的数据还要解析
有两个或两个以上需要 $.each(){}循环遍历
序列化:将对象转化为字符串
反序列化:将字符串转化为对象
16、集合里面插数据插到第一个位置:用Insert(0,"")
而不是add( )
17、var zhiwei = hospitalstaff.Distinct();//去重
18、offset属性:弹框居中
19、//引入事务机制
using (var transaction = _manage.Database.BeginTransaction())
{
try
{
if (_manage.SaveChanges() > 0)
{
//8.提交事务
transaction.Commit();
return Json(true, JsonRequestBehavior.AllowGet);
}
}
catch (Exception)
{
//事务回滚
transaction.Rollback();
}
20、分页js文件
jquery.twbsPagination.js
21、接口,后台接受为实体,可以用data把前台值传过来传值
如果后台接受为一个一个参数,则前台参数只能放在url后面,
否则会404找不到
22、隐藏的东西show()一下就可以出来了
.show();
23、多选获取选中Checkbox
var checkboxs = $("#devicetable input[type=checkbox]");
if (checkboxs!=null&&checkboxs.length>0) {
$.each(checkboxs, function (index, item) {
if (item.checked) {
setAssetPutInStorage.push(item.id);
}
});
}
24、静态页面session传值:
$(".btnAdd").click(function() {
//获取行的主键编号
var id = $(this).attr("data-id");
//存储主键编号
sessionStorage.setItem("data-id", id);
sessionStorage.setItem('user', 'userAdd');
layer.open({
skin: 'layui-layer-molv',
title: false,
type: 2,
area: ['900px', '580px'],
fix: false, //不固定
maxmin: false,
content: 'ParameterConfigurationForm.html?id=' + id + '&guid=' + guid(),
end: function() {
}
});
});
25、弹出框:
var config = {
user: sessionStorage.getItem('user') //sessionStorage.setItem("key", "value")
};
$(function() {
sessionStorage.getItem('user');
if (config.user == "userEdit") {
$("#title").text("编辑参数设置");
}else{
$("#title").text("新增参数设置");
}
});
26、$("#devicetable input[type=checkbox]");//是否为选中
devicetable为整个tr
27、原生js
http://fgm.cc/learn/
28、=== 为绝对相等,即数据类型与值都必须相等
https://vuejs.org/v2/examples/svg.html
登录用post,看不到密码
OtherDrugRecordForm.html:1 Uncaught (in promise)
报错:是因为跨域了
2、数组不能相等,要先tostring()
3、a标签整页刷新,span标签不会换行
4、“路径?参数名=”+参数
5、onclick="return check()" 点击事件方法名前面要加return,否则return false;无法执行
6、toString().trim() 转成string类型,并且去掉前后空白
7、Format():字符串格式化函数.使用很简单.如 string a=string.Format("你的姓名:{0},年龄:{1}","张三",16);
得到的a 就是 "你的姓名:张三,年龄16"
8、$("#createrId option[value='" + data.Creater + "']").attr('selected', true);//jquery实现下拉列表选中
$("select[name='createOption']").val(data.Creater);//js下拉列表选中
9、formatDatetime()
时间格式转换显示年月日
10、session:
Session["LoginId"] = loginId;
string loginid = (string)Session["LoginId"];
11、js委托:
$("#id").on("click", function() {
})
delegate() 方法也是
12、siblings()//使用siblings获取被点击元素之外的同级元素
$(".dingling").siblings().hide();
public HomeController()
{
_hdp = new HDPModel();
}
14、无法将int 隐式转换为int,是否存在一个显示转换
可以为空:.value
15、实体需要序列化,大括号里面的数据还要解析
有两个或两个以上需要 $.each(){}循环遍历
序列化:将对象转化为字符串
反序列化:将字符串转化为对象
16、集合里面插数据插到第一个位置:用Insert(0,"")
而不是add( )
17、var zhiwei = hospitalstaff.Distinct();//去重
18、offset属性:弹框居中
19、//引入事务机制
using (var transaction = _manage.Database.BeginTransaction())
{
try
{
if (_manage.SaveChanges() > 0)
{
//8.提交事务
transaction.Commit();
return Json(true, JsonRequestBehavior.AllowGet);
}
}
catch (Exception)
{
//事务回滚
transaction.Rollback();
}
20、分页js文件
jquery.twbsPagination.js
21、接口,后台接受为实体,可以用data把前台值传过来传值
如果后台接受为一个一个参数,则前台参数只能放在url后面,
否则会404找不到
22、隐藏的东西show()一下就可以出来了
.show();
23、多选获取选中Checkbox
var checkboxs = $("#devicetable input[type=checkbox]");
if (checkboxs!=null&&checkboxs.length>0) {
$.each(checkboxs, function (index, item) {
if (item.checked) {
setAssetPutInStorage.push(item.id);
}
});
}
24、静态页面session传值:
$(".btnAdd").click(function() {
//获取行的主键编号
var id = $(this).attr("data-id");
//存储主键编号
sessionStorage.setItem("data-id", id);
sessionStorage.setItem('user', 'userAdd');
layer.open({
skin: 'layui-layer-molv',
title: false,
type: 2,
area: ['900px', '580px'],
fix: false, //不固定
maxmin: false,
content: 'ParameterConfigurationForm.html?id=' + id + '&guid=' + guid(),
end: function() {
}
});
});
25、弹出框:
var config = {
user: sessionStorage.getItem('user') //sessionStorage.setItem("key", "value")
};
$(function() {
sessionStorage.getItem('user');
if (config.user == "userEdit") {
$("#title").text("编辑参数设置");
}else{
$("#title").text("新增参数设置");
}
});
26、$("#devicetable input[type=checkbox]");//是否为选中
devicetable为整个tr
27、原生js
http://fgm.cc/learn/
28、=== 为绝对相等,即数据类型与值都必须相等
https://vuejs.org/v2/examples/svg.html
登录用post,看不到密码