预览模式: 普通 | 列表

JS获取浏览器名称及版本

A:
var Sys = {},
ua = navigator.userAgent;
if (window.ActiveXObject)
  Sys.ie = ua.match(/MSIE ([\d.]+)/)[1]
else if (window.google && window.chrome){
  Sys.chrome = ua.match(/Chrome\/([\d.]+)/)[1]}
else if (window.Components)
  Sys.firefox = ua.match(/Firefox\/([\d.]+)/)[1]
else if (window.opera)
  Sys.opera = ua.match(/Opera.([\d.]+)/)[1]
else if (!navigator.taintEnabled)

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 31℃

javascript汉字转拼音

<!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-8" />
<title>javascript汉字转拼音</title>
</head>

<body>

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 1993℃

AJAX Javascript CSS 分页代码

<!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-8" />
<title>AJAX Javascript CSS 分页代码</title>
</head>

<body>

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 56℃

JavaScript判断浏览器类型及版本

<!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-8" />
<title>JavaScript判断浏览器类型及版本</title>
</head>

<body>

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 55℃

DIV弹出窗口提示层
完全兼容IE Firefox Chrome Opera Safari
Author : www.531.hk
Create : 2010.02.21
<!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-8" />

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 158℃

JS编码解码函数

<script language="javascript" type="text/javascript">
var Url = {
 
  // public method for url encoding
  _encode : function (string) {
  return escape(this._utf8_encode(string));
  },
 
  // public method for url decoding
  _decode : function (string) {
  return this._utf8_decode(unescape(string));
  },
 
  // private method for UTF-8 encoding

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 93℃

javascript实现可以拖动的层示例(层拖动,兼容IE/FF/Chrome)
<!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-8" />

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 101℃

javascript添加String.Format方法

每次在javascript中用加号合成字符串,真的没法忍受了,今天终于找到一高手写的方法,与大家分享。
使用方式 : String.format("Hello. My name is {0} {1}.", firstName, lastName);
源码:
<script language="javascript" type="text/javascript">
<!--
String.format = function()
{
  if( arguments.length == 0 )
  {
  return null;
  }
 
  var str = arguments[0];

  for(var i=1;i<arguments.length;i++)
  {

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 67℃

js计算页面运行时间

js计算页面运行时间
<!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-8" />
<title>js计算页面运行时间 www.531.hk </title>

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 123℃

AJAX演示示例,完全支持IE FF Chrome

源代码来源网络,经过修改测试;
完全支持IE FF Chrome;
收藏一下,点击以下链接下载源代码;
点击下载此文件』

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 157℃

Javascript获取当前页面HTML源代码

很简单:
document.documentElement.innerHTML

查看更多...

分类:JavaScript | 固定链接 | 评论: 0 | 人气: 264℃