javascript
共 11 篇文章
IE10 改变 Frameset 的cols 属性 无效的解决方法
<!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>无标题文档</title> <link href="../../../style/main.css…
2013-11-29 11:54 · javascript
取得url中的参数对象
/ 取得url中的参数对象 ************************/ function getParaObj(url){ var paraString = url.indexOf("?")>=0 ? url.substring(url.indexOf("?")+1,url.length).split("&") : ; var paraObj = {}; var tem = ""; for (var i=0; tem=paraString*; i++){ paraObj = tem.substring(tem.indexOf("=")+1,tem.length); } return …
2012-12-11 16:12 · javascript
css强制不换行,超出用省略号显示
DIV下的解决方案: 另外,在连接的 title 标签里加入完整的文章标题,这样想知道具体内容的浏览者就可以将鼠标放在连接上,看到完整的标题了。 解释一下起到关键作用的几行代码: overflow:hidden; /* 隐藏超出容器范围的文字 / white-space:nowrap; / 强制文字将不自动换行 / text-overflow:ellipsis; / 如果文字超出范围,将使用省略号标示出来 / -o-text-overflow:ellipsis; / Opera 的私有属性,功能同上 / -icab-text-overflow: ellipsis; -khtml-text-o…
2012-11-29 11:31 · javascript
检查公式括号配对
a)满足在字符串的任何位置处,其左边的左括号数不小于右括号数;b) 字符串中所有的左右括号数相等。 因此,可以采用栈的思想来匹配:遇到左括号入栈,遇到右括号出栈,直到栈为空,或字符串结束停止;字符串扫描结束时,栈也同时为空,则说明匹配。js如下: function checkBracket(algorithms){ var bracket = []; var algorithms= algorithms ||''; for(var i=0; i<algorithms.length; i++){ if(algorithms.charAt(i)=="("){ bracket.push('(');…
2011-12-27 09:27 · javascript
js实现小数转百分比
Number.prototype.toPercent = function(n){n = n || 0;return ( Math.round( this * Math.pow( 10, n + 2 ) ) / Math.pow( 10, n ) ).toFixed( n ) + '%';} var A=0.358975, B=0.25554; alert([A, A.toPercent(3), B, B.toPercent()].join('\n'));
2011-12-26 15:05 · javascript
IE6下链接ONCLICK事件处理中的请求被ABORTED
IE6下链接ONCLICK事件处理中的请求被ABORTED 一大早发现,ie6下点发起对话没法弹出窗口,ff浏览器就是可以的。开启HttpWatch检测,发现点击的被aborted。 查找资料显示aborted的原因如下。 The (Aborted) value is more complex in its origin. It occurs when IE has started to process the request for a URL (e.g. to download an image), but then decides to cancel the operation. He…
2011-08-25 17:16 · javascript · javascript httpwatch aborted
网页中打开notepad,word
<script language="JavaScript"> function open_exe(shellp,str) { a=new ActiveXObject("wscript.shell"); a.run(shellp+" "+str); } function cq() { b=new ActiveXObject("wscript.shell"); b.run("rundll32.exe") } </script> <button onclick="open_exe('notepad.exe','')">打开notepad</button> <button onclick="open…
2011-08-15 09:05 · javascript
jquery 缓存问题
转载: http://halk.iteye.com/blog/592306 现象: 页面使用jQuery的Ajax方式更改内容,提交保存至数据库后使用jQuery.getJSON方式重新读取数据,页面没有更新,重新登录系统后页面才显示更改后的数据。 原因: IE会缓存jQuery的get请求,导致不能查询到新的数据 解决方法 : 1、在请求URL后添加随机数,例如: Js代码 var url ="/operaterMultiAction.do?randomNum="+Math.random(); var url ="/operaterMultiAction.do?randomNum="+Ma…
2011-03-21 10:11 · javascript
js导出HTML到EXCEL(ONLY IE)
<!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导出HTML到EXCEL(ONLY IE)</title> <script langu…
2011-02-25 14:22 · javascript
JavaScript 图片变换效果(ie only)
http://www.cnblogs.com/cloudgamer/archive/2008/05/23/1205642.html
2011-02-14 17:07 · javascript
JS获取GET参数
对于 URL,我们需要了解更多,因为我们的开发中可能会需要提取URL的部分信息来做不同的事情,事实上这也是与后端交互的一种独特的方式,当然这肯定是安全的,当请求被返回,关于 url 的信息就被记录在了 Window 对象的 Location对象中,取值的结果并不随着用户手动修改地址栏中的字符而发生任何改变,这一点是很重要的。了解了这些内容,那么我们从下面这张图开始吧: 图片中间那一行较长的字符串是一个完整的 URL,它包含了一个 URL 中可能包含的任何部分:协议、域名、端口号(当然,大多数情况下,我们在浏览网页的时候并没有看到端口号,因为他被隐藏了,默认就是80端口,你加上也不会有错)、路…
2011-01-26 16:49 · javascript