随笔分类 -  JavaScript

摘要:1、IE浏览器加入收藏夹的代码window.external.addFavorite(sURL,sTitle);参数:sURL:添加到收藏夹的完整网站页面地址sTitle:添加到收藏夹中的网站页面标题名称。示例:<ahref='#'onClick="javascript:window.external.AddFavorite('http://xxx.net','xxx网');">加入收藏</a>2、Firefox浏览器加入收藏夹的代码Firefox中叫做加入书签(收藏夹),代码有两种方式,一种同IE浏览 阅读全文
posted @ 2012-03-26 15:37 憶言 阅读(228) 评论(0) 推荐(0)
摘要:<!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><meta http-equiv="Content-Type" content="text/html; charset=gb23 阅读全文
posted @ 2012-03-26 15:29 憶言 阅读(288) 评论(0) 推荐(0)
摘要:*以下代码均转自懒人图库。 3D图片相册效果 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title></title><style type="text/css"> html { overflow: hidden; } body { position: absolute; margin: 0px; pad 阅读全文
posted @ 2012-03-26 15:25 憶言 阅读(122) 评论(0) 推荐(0)
摘要:不做解释,自己分析。纵向滚动(代码有待完善):<!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><meta http-equiv="Content-Type" content=" 阅读全文
posted @ 2012-03-26 15:23 憶言 阅读(174) 评论(0) 推荐(0)
摘要:样式一:<!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>右侧悬浮的QQ在线客服</title><meta http-equiv="content-type&q 阅读全文
posted @ 2012-03-26 15:19 憶言 阅读(496) 评论(0) 推荐(0)
摘要:JavaScript代码部分:<script type="text/javascript">function TiJiao(){document.getElementById("BiaoDan").action="JieShou.php";document.getElementById("BiaoDan").submit();}</script>表单部分:<form id="BiaoDan" name="BiaoDan" method=" 阅读全文
posted @ 2012-03-26 11:52 憶言 阅读(860) 评论(0) 推荐(1)
摘要:<!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><meta http-equiv="Content-Type" content="text/html; charset=utf- 阅读全文
posted @ 2012-03-26 11:51 憶言 阅读(725) 评论(0) 推荐(0)
摘要:<ahref="javascript:window.external.AddFavorite(location.href,'${course.name}收藏');">添加到收藏夹</a>是我写的添加到收藏夹的代码。但是当我用IE8调试的时候浏览器报找不到元素错误。当我用Firefox调试的时候报window.external.AddFavorite()isnotafunction错误。但是我用360浏览器就能添加到收藏夹。为此我查阅了一些资料,找到了适合我的解决办法。方法如下:1、点击开始-运行-regedit-确定2、寻找HKEY_ 阅读全文
posted @ 2012-03-25 15:44 憶言 阅读(315) 评论(0) 推荐(0)
摘要:<script>functiongetInfo(){vars="";s+="网页可见区域宽:"+document.body.clientWidth;s+="网页可见区域高:"+document.body.clientHeight;s+="网页可见区域宽:"+document.body.offsetWidth+"(包括边线和滚动条的宽)";s+="网页可见区域高:"+document.body.offsetHeight+"(包括边线的宽)";s+ 阅读全文
posted @ 2012-03-25 15:21 憶言 阅读(187) 评论(0) 推荐(0)
摘要:网页禁止保存代码为:<noscript><iframe src="*.htm"></iframe></noscript>本机ip<%=request.servervariables("remote_addr")%>服务器名<%=Request.ServerVariables("SERVER_NAME")%>服务器IP<%=Request.ServerVariables("LOCAL_ADDR")%>服务器端口<%=Reques 阅读全文
posted @ 2012-03-25 15:16 憶言 阅读(593) 评论(0) 推荐(0)
摘要:按钮式:<INPUTname="pclog"type="button"value="/GO"onClick="location.href='http://www.itpx.net/'">链接式:<ahref="javascript:history.go(-1)">返回上一步</a><ahref="<%=Request.ServerVariables("HTTP_REFERER")%>"& 阅读全文
posted @ 2012-03-25 15:11 憶言 阅读(301) 评论(0) 推荐(0)
摘要:1 history.go(0)2 location.reload()3 location=location4 location.assign(location)5 document.execCommand('Refresh')6 window.navigate(location)7 location.replace(location)8 document.URL=location.href自动刷新页面的方法:1.页面自动刷新:把如下代码加入<head>区域中<meta http-equiv="refresh" content="2 阅读全文
posted @ 2012-03-25 15:09 憶言 阅读(182) 评论(0) 推荐(0)
摘要:有的时候我们可能需要了解浏览者所使用的显示器分辨率,从而帮助我们网页设计们了解浏览者的一些情况,下面就简单介绍一下利用JavaScript获取屏幕分辨率的方法。<script type="text/javascript" language="javascript">document.write('您显示器的分辨率为:\n' + screen.width + '×' + screen.height + ' 像素');</script> 阅读全文
posted @ 2012-03-25 14:57 憶言 阅读(464) 评论(0) 推荐(0)
摘要:例子:<html><body><input type="text" id="clock" size="35" /><script language=javascript>var int=self.setInterval("clock()",50)function clock() { var t=new Date() document.getElementById("clock").value=t }</script><button 阅读全文
posted @ 2012-03-25 14:56 憶言 阅读(240) 评论(0) 推荐(0)
摘要:1、IE浏览器加入收藏夹的代码window.external.addFavorite(sURL, sTitle);参数:sURL:添加到收藏夹的完整网站页面地址sTitle:添加到收藏夹中的网站页面标题名称。示例:<a href='#' onClick="javascript:window.external.AddFavorite('http://weste.net', '财经网');">加入收藏</a>2、Firefox浏览器加入收藏夹的代码Firefox中叫做加入书签(收藏夹),代码有两种方式,一种 阅读全文
posted @ 2012-03-25 14:44 憶言 阅读(529) 评论(0) 推荐(0)