1.网页技术分为三个方面:静态网页、网页美工、动态网页。
2.DHTML(动态HTML)是一种通过各种技术的综合而得以实现的概念,包括三部分:HTML、Script(JavaScrip or VBScript)、CSS(Cascading Style Sheets)。
[color=red]1.删除提示[/color]
1)<a href="#" οnclick="return(confirm('删除后无法恢复,您确定删除吗?'))">删除</a>
2)JS
<a href="#" >删除</a>
<script language="JavaScript" type="text/javascript">
function delete_confirm(){
if(event.srcElement.outerText=="删除" || event.srcElement.value=="删除")
event.returnValue=confirm("删除后将不能恢复,您确认执行删除操作么?");
}
document.οnclick=delete_confirm;
</script>
[color=red]2.点击按钮探出提示[/color]
<input type=button value="reload" οnclick="javascript:reload()">
<script type="text/javascript">
function reload() {
if (confirm("确认?"))
{
var url="#";
window.location.href=url;
}
}
[color=red]
3.点击链接弹出提示[/color]
<a href="确认后的连接地址" οnclick="return(confirm('想要的提示信息?'))">显示信息</a>
[color=red]4.onchange()用法[/color]
<select name="year" οnchange="javascript:changeYear()">
<OPTION OPTION>
</SELECT>
<SCRIPT language="javascript">
function changeYear(){
var url = ....;
window.location.href = url;
}
</SCRIPT>
[color=red]
5.根据选择的radio转向不同的URL[/color]
<input type="Radio" name="id" value="1" checked></td>
<input type="Radio" name="id" value="2" checked></td>
<input type="Radio" name="id" value="3" checked></td>
<SCRIPT language="javascript">
function WhichOneisChecked(obj) {
for (var i = 0;i < obj.elements.length;i++){
if (obj.elements[i].checked == true){
var weekLogId=obj.elements[i].value;
var url="......";
window.location.href = url;
}
}
}
</SCRIPT>
[color=red]
6.radio 全选[/color]
function checkAll(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked;
}
function check(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getElementsByName(e.name);
for (var i=0; i<aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
<input type=checkbox checked name=allTeams οnclick="checkAll(this, 'teamIds')">
<input type="checkbox" name="teamIds" checked value="<%=.....%>" οnclick="check(this, 'allTeams')">
[color=red]7.DIV 的显示、隐藏[/color]
链接实现
<script language="javascript">
function showLay(divId){
var objDiv = eval(divId);
if (objDiv.style.display=="none"){
eval("sp"+divId+".innerHTML='隐藏'");
objDiv.style.display="";
}else{
eval("sp"+divId+".innerHTML='查看'");
objDiv.style.display="none";
}}
</script>
<td>
<a href="#" οnclick="showLay('Layer1')"><span id="spLayer1">查看</span></a>
<br>
<div id="Layer1" style="display:none;">......</div>
</td>
按钮实现
<SCRIPT LANGUAGE="JavaScript">
function hidden_show()
{
var obj = document.getElementById("Layer1");
if(obj.style.visibility == "")
obj.style.visibility = "hidden";
else
obj.style.visibility = "";
}
</SCRIPT>
<td>
<INPUT TYPE="button" οnclick="hidden_show();" value="hidden/show">
<br>
<div id="Layer1" >
<%=weekPlan%>
</div>
</td>
2.DHTML(动态HTML)是一种通过各种技术的综合而得以实现的概念,包括三部分:HTML、Script(JavaScrip or VBScript)、CSS(Cascading Style Sheets)。
[color=red]1.删除提示[/color]
1)<a href="#" οnclick="return(confirm('删除后无法恢复,您确定删除吗?'))">删除</a>
2)JS
<a href="#" >删除</a>
<script language="JavaScript" type="text/javascript">
function delete_confirm(){
if(event.srcElement.outerText=="删除" || event.srcElement.value=="删除")
event.returnValue=confirm("删除后将不能恢复,您确认执行删除操作么?");
}
document.οnclick=delete_confirm;
</script>
[color=red]2.点击按钮探出提示[/color]
<input type=button value="reload" οnclick="javascript:reload()">
<script type="text/javascript">
function reload() {
if (confirm("确认?"))
{
var url="#";
window.location.href=url;
}
}
[color=red]
3.点击链接弹出提示[/color]
<a href="确认后的连接地址" οnclick="return(confirm('想要的提示信息?'))">显示信息</a>
[color=red]4.onchange()用法[/color]
<select name="year" οnchange="javascript:changeYear()">
<OPTION OPTION>
</SELECT>
<SCRIPT language="javascript">
function changeYear(){
var url = ....;
window.location.href = url;
}
</SCRIPT>
[color=red]
5.根据选择的radio转向不同的URL[/color]
<input type="Radio" name="id" value="1" checked></td>
<input type="Radio" name="id" value="2" checked></td>
<input type="Radio" name="id" value="3" checked></td>
<SCRIPT language="javascript">
function WhichOneisChecked(obj) {
for (var i = 0;i < obj.elements.length;i++){
if (obj.elements[i].checked == true){
var weekLogId=obj.elements[i].value;
var url="......";
window.location.href = url;
}
}
}
</SCRIPT>
[color=red]
6.radio 全选[/color]
function checkAll(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked;
}
function check(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getElementsByName(e.name);
for (var i=0; i<aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
<input type=checkbox checked name=allTeams οnclick="checkAll(this, 'teamIds')">
<input type="checkbox" name="teamIds" checked value="<%=.....%>" οnclick="check(this, 'allTeams')">
[color=red]7.DIV 的显示、隐藏[/color]
链接实现
<script language="javascript">
function showLay(divId){
var objDiv = eval(divId);
if (objDiv.style.display=="none"){
eval("sp"+divId+".innerHTML='隐藏'");
objDiv.style.display="";
}else{
eval("sp"+divId+".innerHTML='查看'");
objDiv.style.display="none";
}}
</script>
<td>
<a href="#" οnclick="showLay('Layer1')"><span id="spLayer1">查看</span></a>
<br>
<div id="Layer1" style="display:none;">......</div>
</td>
按钮实现
<SCRIPT LANGUAGE="JavaScript">
function hidden_show()
{
var obj = document.getElementById("Layer1");
if(obj.style.visibility == "")
obj.style.visibility = "hidden";
else
obj.style.visibility = "";
}
</SCRIPT>
<td>
<INPUT TYPE="button" οnclick="hidden_show();" value="hidden/show">
<br>
<div id="Layer1" >
<%=weekPlan%>
</div>
</td>