1.将页面分成几块,可进行按块刷新。 写道
说明:利用frame,将页面进行分块,可进行某一块的刷新,实例如下。
<script>
function iFrameHeight() {
var ifm= document.getElementById("M1");
var subWeb = document.frames ? document.frames["M1"].document : ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
function goT(id){
document.getElementById('M1').style.display='block';
document.getElementById('M1').src='beautyClassDetail.htm?beautyClassBoundId='+id;
}
</script>
<a href="JavaScript:void(0)" οnclick="goT(${displayTable.id})" >${displayTable.id}</a>
<script>
function iFrameHeight() {
var ifm= document.getElementById("M1");
var subWeb = document.frames ? document.frames["M1"].document : ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
function goT(id){
document.getElementById('M1').style.display='block';
document.getElementById('M1').src='beautyClassDetail.htm?beautyClassBoundId='+id;
}
</script>
<a href="JavaScript:void(0)" οnclick="goT(${displayTable.id})" >${displayTable.id}</a>
<iframe id="M1" name="M1" frameBorder=0 scrolling=no width="100%" onLoad="iFrameHeight();"
style="display: none"></iframe>
2.ExtJs时间组件
Ext.onReady(function(){
Ext.QuickTips.init();
var startTime = new Ext.form.DateField({
id:'startTime',
applyTo : 'startTime',
format: 'Y-m-d',
altFormats: 'Ymd',
vtype: 'daterange',
endDateField: 'endTime'
});
var endTime = new Ext.form.DateField({
id:'endTime',
applyTo : 'endTime',
format: 'Y-m-d',
altFormats: 'Ymd',
vtype: 'daterange',
startDateField: 'startTime'
});
points = new Ext.form.NumberField({
applyTo : 'points',
allowBlank : false,
decimalSeparator : '.',
decimalPrecision : 2,
minValue : 0,
maxValue : 99999999,
blankText : "<fmt:message key='points.required'/>"
});
});
function checkDate(startTime,endTime){
var dateS=document.getElementById(startTime).value;
var dateN=document.getElementById(endTime).value;
if(Date.parse(dateS.replace('-','/'))>Date.parse(dateN.replace('-','/'))){
alert('<fmt:message key="points.dateError"/>');
document.getElementById(endTime).value='';
return false;
}
else
return true;
}
function check(){
if(!points.validateValue(points.getValue())){
alert("<fmt:message key='points.error'/>");
checkPoints();
return false;
}
if(!reason.validateValue(reason.getValue())){
alert("<fmt:message key='points.required'/>");
return false;
}
if(!adjustmentCategoryId.validateValue(adjustmentCategoryId.getValue())){
alert("<fmt:message key='points.required'/>");
return false;
}
else{
return true;
}
}
<c:if test="${storeModifyBO.flag =='success'}">
alert("<fmt:message key='points.updatesuccess'/>");
window.parent.location.href="storeModify.htm";
</c:if>