URI是唯一标识,但是不一定能找到,不是定位资源,是标识资源,
URL是唯一标识,但同时还能找到,可以定位资源。
URL是URI的子集
前台向后台传递汉字:encodeURIComponent(汉字)
$("#ID").attr("class","validate[required,isNumeric[6,2]] form-control");
$(this).attr("style","display: none;");
$("#ID").attr("style","display: '';");
$("#ID").removeClass("container-include-mln");
$("#ID").addClass("container-include-mln");
$("#ID").css("display","none");
$("#ID",parent.document).css("display","");
document.getElementById("ID").style.display="";
document.getElementById("ID").style.display="none";
document.getElementById("ID").readOnly=false;
<li title="0.00" YC>0.00</li>
$("li[YC]").each(function(){
ids.push(this.id);
});
for(var k in list){
console.log(k+'========'+list[k]);
}
$.each(data.xData,function(i,n){
console.log(i+'========'+n);
})
$.each(data,function(){
console.log('========'+this.psId);
for(var key in this){
oneModel.find("#"+key).text(this[key]);
}
});
$('.box').each(function() {
console.log($(this).attr('dataId'));
console.log($(this).position().left);
console.log($(this).position().top);
});
***********************************************************
var arr = [ "aaa", "bbb", "ccc" ];
$.each(arr, function(i,a){
alert(i); // i 是循环的序数
alert(i); // a 是值
});
处理json
var obj = { one:1, two:2, three:3};
$.each(obj, function(key, val) {
alert(key); //键
alert(val); //值
});
***********************************************************
//闭包
function a() {
var i = 0;
function b() {
console.log(i--);
}
function c() {
console.log(i++)
}
return [b, c]
}
var m = a();
m[0]();0
m[0]();-1
m[0]();-2
m[1]();-3
m[1]();-2
m[1]();-1
//回调
function doSomething(callback){
callback(1,2);
}
function numberAdd(a,b){
document.write(a+b);
}
doSomething(numberAdd);//3
// 转义${}类型参数
function getcollect(el) {
var regexp = new RegExp("\\\$\\{(.*?)\\}", "g");
var rs = null;
while ((rs = regexp.exec(el)) != null) {
el = eval("el.replace(rs[0],paramMap." + rs[1] + ")");
}
return el;
}
location.href=encodeURI(getcollect(url)).replace("#","%23");
window.location.href='/***/***/***.action?name='+encodeURIComponent('汉字');
$.ajax({
type:"POST",
url:"/***/***/***.action",
dataType : "json",
async:true,
data : {
eqid:$('#eqid').val()
},
error: function(data,transport){
},
success: function(data){
}
});