截取最后一个字符串
dirConStr=dirConStr.substring(0,dirConStr.length-1)
上传头像
页面
<form id="uploadForm" enctype='multipart/form-data'>
<div class="form-group ITEM" >
<div class="col-sm-4 h_user_profilepicture profilePicture">
<div class="fileinput-new">
<input type="file" name="file" id="picture" style="display:none"/>
<img id="previewImg" style="width: 140px;height: 140px;display: block;" src="" alt="" onclick="F_Open_dialog()"/>
</div>
</div>
</div>
</form>
js
function F_Open_dialog()
{
$("#picture").click();
}
$("#picture").change(function(){
var file = this.files[0];
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function(e){
$("#previewImg").attr("src", e.target.result);
};
});
$('.saveCard').on('click',function () {
var picture = document.getElementById('picture').files[0];
var formdata = new FormData();
formdata.append("file",picture);
$.ajax({
type: "POST",
url: "/upload/common/uploadfile",
data : formdata,
dataType : 'json',
cache : false,
processData:false,
contentType:false,
success: function (result) {
console.log(result)
}
})
})
表单选取
var tutorType=$("input[name='tutorType']:checked").val();
$("input[type=radio][name=angel][value=0]").attr("checked",'checked')
保存数据到浏览器
关于echarts省份地图不显示
友情提醒
option={
series: [{
type: 'map',
map: '浙江' //省份的map名字是中文
}]
};