随笔分类 -  Js和Ajax技术

摘要:function getCursorPos(obj){var rngSel = document.selection.createRange();//建立选择域var rngTxt = obj.createTextRange();//建立文本域var flag = rngSel.getBookmark();//用选择域建立书签rngTxt.collapse();//瓦解文本域到开始位,以便使标志位移动rngTxt.moveToBookmark(flag);//使文本域移动到书签位rngTxt.moveStart('character',-obj.value.length);// 阅读全文
posted @ 2007-10-15 22:41 音乐啤酒 阅读(1912) 评论(0) 推荐(0) 编辑
摘要:用的时候不会用。也难找。以后多多收集。以后好用1.替换一个字符串中一个字符成另一个字符replace(/\*/g,'/')//把字符中\替换为/IP地址匹配的正则:"^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$"验证是否整数String.prototype.trim = function () { return this.replac 阅读全文
posted @ 2007-09-11 00:53 音乐啤酒 阅读(128) 评论(0) 推荐(0) 编辑
摘要:<script language="javascript"> var oWin; function openIt() { oWin=window.open("test.txt","myWin"); } function saveIt() { oWin=window.open("test.txt","myWin"); oWin.document.execCommand("saveAs",false,"c:\\2.txt") } </scri 阅读全文
posted @ 2007-06-22 19:09 音乐啤酒 阅读(918) 评论(0) 推荐(0) 编辑
摘要:前台的js页面:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="displayDepartment.aspx.cs" Inherits="OASolution.Web.systemModule_displayDepartment" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/x 阅读全文
posted @ 2007-06-08 19:42 音乐啤酒 阅读(312) 评论(0) 推荐(0) 编辑
摘要:<HTML><HEAD><title>提醒信息</title><base target="_blank"><SCRIPT language="JavaScript"> window.resizeTo(220,210); var windowW=220 // wide var windowH=210 // high var Yoffset=0 // in pixels, negative values allowed var windowStep=2 // move increment 阅读全文
posted @ 2007-05-26 19:53 音乐啤酒 阅读(236) 评论(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=utf- 阅读全文
posted @ 2006-09-22 23:24 音乐啤酒 阅读(204) 评论(0) 推荐(0) 编辑
摘要:<img src="pic/2006-8-21000爱戴.jpg" class="drag" title="拖动图片" /><img src="pic/jpg-btn-deco.jpg" class="drag" /><div class="drag">AAAAAAAAAA</div><script language="JavaScript">var dragapproved=falsevar z 阅读全文
posted @ 2006-08-31 22:30 音乐啤酒 阅读(215) 评论(0) 推荐(0) 编辑