ITeye博客

javascript

共 5 篇文章

fckeditor 检测输入长度

取值的办法 FCKeditorAPI.GetInstance(ClientID).GetXHTML(true) 以下是设值的办法 FCKeditorAPI.GetInstance(ClientID).SetHTML("字符串") 利用JS插入一段字符串 FCKeditorAPI.GetInstance('content').SetHTML(FCKeditorAPI.GetInstance(''content'').GetXHTML(true) + "插入的字符串")

2007-10-30 12:52 · javascript

javascript 比较开始时间和结束时间

//时间格式 2007/01/01 var bvalue=document.getElementById('begin_time').value; var evalue=document.getElementById('end_time').value; if(bvalue.length>9 && evalue.length>9){ var d1 = new Date(bvalue); var d2 = new Date(evalue); if(Date.parse(d1) - Date.parse(d2)>=0){ alert("please select end_time later t…

2007-10-19 12:03 · javascript

javascript 判断中文字符长度

js 代码 <script language=< span="">"javascript"> String.prototype.gblen = function() { var len = 0; for (var i=0; i<this.length; i++) { if (this.charCodeAt(i)>127 || this.charCodeAt(i)==94) { len += 2; } else { len ++; } } return len; } String.prototype.gbtrim = function(len, s) { var str = ''; var s…

2007-05-16 11:15 · javascript

不同浏览器 JavaScript 的getYear 问题

同样的方法 var date=new Date(); document.write(date.getYear()); IE 输出 2006 Firefox 输出 106 解决方法: 使用date.getFullYear() IE 输出 2006 Firefox 输出 2006 参考资料 JScript getYear 方法 返回 Date 对象中的年份值。 dateObj.getYear() 必选项 dateObj 参数为 Date 对象。 说明 这个方法已经过时,之所以提供这个方法,是为了保持向后的兼容性。请改用 getFullYear 方法。 对于1900-1999这段时间而言,返回的年…

2006-12-27 11:28 · javascript

[转]用于刷新网页的javascript函数

window.history.go(0) window.location.reload() window.location.href=location.href window.location.assign(location.href) document.execCommand('Refresh') window.navigate(location.href) window.navigate("#pos"); window.location.replace(location.href) window.open('自身的文件','_self') ------------- location.r…

2006-12-06 13:08 · javascript