Javascript跳转
GengV
<a href="javascript:;"
onClick="javascript:window.open('admin_fk.asp?id=')"> 文字部分</a>
<a href="#"onclick="del(id)">删除</a>会出现不正常跳转,将
#改成javascript:void(0)就可以了
#包含了一个位置信息
默认的锚点是#top 也就是网页的上端
而javascript:void(0) 仅仅表示一个死链接
这就是为什么有的时候页面很长浏览链接明明是#可是
跳动到了页首
而javascript:void(0) 则不是如此
所以调用脚本的时候最好用void(0)
或者<input onclick>
<div onclick>等
打开新窗口链接的几种办法
1.window.open('url')
2.用自定义函数
<script type="text/javascript">
function del(consumer_id){
window.location.href="<%=basePath%>datamaintainservlet?command=consumerDel&consumer_id="+consumer_id;
}
</script>
正解:
<a href="javascript:void(0)"
onclick="del(${consumer_id})">删除</a>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zjx2388/archive/2009/02/20
/3913547.aspx
Button链接,代码如下:
1.链接到某页
<input type="button" name="Submit" value="确 定" class="btn"
onclick="location.href='filename.html'" />
2.返回(等同后退)
<input name="Submit2" type="button" class="btn"
onclick="location.href='javascript:history.go(-1);'" value="返 回" />
3.打开新网页
<input type="button" name="Submit2" value="确 定" class="btn"
onclick="window.open('filename.html')" />
4.打开无边框的新窗口
<input type="button" name="Submit2" value="确 定" class="btn"
onclick="javascript:window.open('filename.html','','width=720,height=500,resizable=yes,scrollbars=yes,status=no')"
/>
5.打开新网页同时指向另一页
<input type="button" name="Submit2" value="确 定" class=&q
相关文档:
基本上全部加了注释,一行一注....呵呵
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>数组排序</title>
<mce:style type="text/css"&g ......
JavaScript 时间加减:
<HTML>
<BODY>
<script type="text/javascript">
var time = new Date("04/30/2010");
document.write(time);
......
///
<summary>
///
一些常用的Javascript方法
///
</summary>
public
static
class
Jscript
{
///
<summary>
///
弹出提示框
///
</summary>
public
static
void
Alert(Page page ......
html:
<html>
<head>
<title>calendaragain</title>
<link rel=stylesheet href="calendaragain.css">
<script type = " ......