
JavaScript
iteye_2179
这个作者很懒,什么都没留下…
展开
-
JavaScript实现ReplaceAll 方法
JavaScript String Replace All The JavaScript function for String Replace replaces the first occurrence in the string. The function is similar to the php function str_replace and takes two simple par...原创 2010-08-13 11:46:35 · 148 阅读 · 0 评论 -
javascript endwith startwith
String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1;}; function endsWith(str, suffix) { return str.indexOf(suffix, ...原创 2012-03-11 03:58:51 · 103 阅读 · 0 评论 -
Text 输入回车之后执行的操作
文本框接收到回车字符,执行queryByUserName函数。原创 2011-03-01 09:54:58 · 303 阅读 · 0 评论 -
JavaScript实现弹出窗口
function selectTime(id){ var url = "enterprise/qy1003_selectTime.jsp"; url += "?id=" + id; window.open (url, 'newwindow', 'height=100, width=400, top=400,left=500, too...原创 2011-03-01 09:51:45 · 95 阅读 · 0 评论 -
JS中将字符串转为XML并读取对象的值
在java端将字符串转化为xml对象可以使用DocumentHelper.parseText(xmlReturn).getRootElement(); 在js中同样有方法可以将字符串转化为xml对象,可以使用如下函数function createXml(str){ if(document.all){ var xmlDom=new ActiveXObject( "Micr...原创 2011-10-05 15:06:28 · 109 阅读 · 0 评论 -
javascript解析xml文件。兼容IE、firefox、Chrome
html<div id="bookList" style="width:500px;"><script language="javascript">loadXML = function(fileRoute){ xmlDoc=null; if (window.ActiveXObject){ xmlDoc = new ActiveXObject('M...原创 2011-09-28 17:23:33 · 123 阅读 · 0 评论 -
Jquery 动态发送Ajax请求,接受Jason格式的数据
Jason数据格式:[{"title":"本市公布2011学年主要教育收费项目与收费标准","totalnum":"6","link":"/zwgk/tzggzwgk/czywgg/201108/t20110830_128689.html","date":"2011.08.30 17:04:00"},{"title":&quo原创 2011-09-28 15:31:34 · 184 阅读 · 0 评论 -
Javascript String StartWith endWith
String.prototype.startsWith = function(prefix) { return this.indexOf(prefix) === 0;}String.prototype.endsWith = function(suffix) { return this.match(suffix+"$") == suffix;};原创 2011-08-30 15:56:46 · 124 阅读 · 0 评论 -
Div 实现弹出层
<html><head> <script> function locking(){ document.all.ly.style.display="block"; document.all.ly.style.width=document.body.clientWidth; document.all.ly.style.hei...原创 2010-09-26 10:51:19 · 106 阅读 · 0 评论 -
JavaScript 去掉字符串两端的空格
//去掉字符串的空格 function removeAllSpace(str){ var localString = ''; for(var index = 0; index<str.length; index++) if(str.charCodeAt(index)!= 32){ ...原创 2010-09-21 12:58:26 · 90 阅读 · 0 评论 -
j将表格数据转换成Word、Excel
JavaScript 弹出询问窗口 var returnValue=showModalDialog("../zlfx/fx_getbglx.jsp",null,"dialogWidth:350px;dialogHeight:150px;center:yes;help:no;status:no;scroll:no"); if(returnValue=="word"){ ...原创 2010-09-16 09:24:23 · 135 阅读 · 0 评论 -
JavaScript中各编码解码函数的区别和注意事项
JavaScript 中encodeURI,encodeURIComponent与escape的区别和注意大家在使用JS提交数据时,尤其是中文的时候,经常会需要将要提交的字符串进行URL编码。在JS中对字符串进行URL编码有好几种方 法,encodeURI,encodeURIComponent,还有escape。在我看到的很多代码中escape这个函数用的最多,不过这个函数却 是不推荐...原创 2010-09-09 13:35:50 · 91 阅读 · 0 评论 -
JavaScript 转码方式
javaScript中URL编码转换,escape() encodeURI() encodeURIComponentjavaScript中URL编码转换,escape() encodeURI() encodeURIComponent 在使用url进行参数传递时,经常会传递一些中文名的参数或URL地址,在后台处理时会发生转换错误。在有些传递页面使用GB2312,而在接收页面使用U...原创 2010-09-09 13:31:16 · 155 阅读 · 0 评论 -
Javascript 数字变量减法
Javascript 中数字变量减法就可以直接减数字的加法要先把数字转换成Int类型 或者Float类型才可以。 代码如下:currentPage = parseInt(currentPage) + parseInt(1); ...原创 2010-09-07 16:49:58 · 219 阅读 · 0 评论 -
JavaScript 去掉文本左右的空格
//去掉字符串的空格 function removeAllSpace(str){ var localString = ''; for(var index = 0; index原创 2010-08-25 15:41:00 · 93 阅读 · 0 评论 -
Select 设置选中项
<script>function c_ss(va){var i,num,opnum=document.form1.ss.lengthfor(i=0;i<num;i++){ op=document.form1.ss.options[i] if(op.value==va) op.selected=true;}}</script><form name="for...原创 2010-08-16 14:42:15 · 142 阅读 · 0 评论 -
Select 动态添加节点
var year = nodes[i].text; var oOptionBegin = document.createElement("option"); oOptionBegin.appendChild(document.createTextNode(year)); oOptionBegin.setAttribute("value","test"); begin.appendChi...原创 2010-08-13 20:00:49 · 180 阅读 · 0 评论 -
JavaScript 实现 StartWith endWith trim 方法
<script type="text/javascript">String.prototype.endWith=function(s){if(s==null||s==""||this.length==0||s.length>this.length)return false;if(this.substring(this.length-s.length)==s)return true...原创 2013-01-04 14:24:27 · 164 阅读 · 0 评论