摘要:<!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>Untitled Page</title></head><body onload="f()&qu
阅读全文
摘要:查询HTML标签select中options的值并定位其位置!JavaScript实现!示例:<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN"> <HTML> <HEAD> <TITLE>NewDocument</TITLE> <META NAME="Author" CONTENT="majianan"> <SCRIPT> varcurrentSel=null; function setBu
阅读全文
摘要:一、基础理解:var e = document.getElementById("selectId");e. options= new Option("文本","值") ;//创建一个option对象,即在<select>标签中创建一个或多个<option value="值">文本</option>//options是个数组,里面可以存放多个<option value="值">文本</option>这样的标签1:options[ ]数组的
阅读全文
摘要:<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><?phpif('source'==$_GET['act'])//查看源代码{show_source($_SERVER["SCRIPT_FILENAME"]);exit;}set_time_limit(0);for($i=0;
阅读全文
摘要:<html><head> <style type="text/css"> /**//* YOU CAN REMOVE THIS PART */ body{ background-image:url('http://images.cnblogs.com/heading3.gif'); background-repeat:no-repeat; padding-top:85px; font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif; ...
阅读全文
摘要:function del_blank(str1){//删除空格var reg = /\s+/g;return str1.replace(reg,'');}
阅读全文
摘要:W3C那帮人的脑袋被驴踢了,直到javascript1.8.1才支持trim函数(与trimLeft,trimRight),可惜现在只有firefox3.5支持。由于去除字符串两边的空白实在太常用,各大类库都有它的影子。加之,外国人都很有研究精神,搞鼓了相当多实现。实现1String.prototype.trim = function() { return this.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }看起来不怎么样,动用了两次正则替换,实际速度非常惊人,主要得益于浏览器的内部优化。一个著名的例子字符串拼接
阅读全文
摘要:A few weeks ago, as developers are wont to do, I rewrote our online gameroom. Version 1 was getting crusty, and I'd written all the AJAX handlers manually and wanted to clean up the code by using Prototype and Script.aculo.us. You may recall we discussed using these tools to build a Web 2.0 inte
阅读全文