1. js中使用java代码 var rootRegionId = "<%= NewsConstant.ROOTREGIONID%>"; if(country == rootRegionId && common == "false"){ checkResult += "查询条件矛盾:区域为综合但是又不包含综合类新闻!\n"; } 2. 获取下拉框的值 var select = document.getElementById("selectId"); var selectValue = select.options[select.selectedIndex].value 3. 动态 ...
在一用struts titles的页面中不能再加body(不知道到底能不能加,反正加了报错,只能不用body了),只能在无body的情况下实现onload事件,主要有以下三中方法: 1.window.onload window.onload = function() { init('country', 'provience', 'city'); select('000000000', 'country'); } 2.window.onload function initFunction(){ init('country', 'provience', 'city'); select(' ...
http://www.seelearn.com/user1/jamos/index.html var obj=document.getElementById("ID") 根据指定的ID属性值得到对象。返回id属性值等于ID的第一个对象的引用。假如对应的为一组对象,则返回该组对象中的第一个。 <input name="a” type="text" id="b"/> <input name="b” type="text" id="a"/> <input type="button" name="submint1" value="text1" onclick="alert(doc ...
Javascript中为String对象添加trim <script language=Javascript> //自己动手为string添加Trim function String.prototype.Trim() {return this.replace(/(^\s*)|(\s*$)/g,"");} function String.prototype.Ltrim(){return this.replace(/(^\s*)/g, "");} function String.prototype.Rtrim(){return this.replace(/(\s*$)/g, "");} & ...
问题: 两个js放到一起只能调用其中的一个,另外一个里面的方法失效。而且它们合并到一起新加的那些方法都不好使了。 参考: http://www.cnblogs.com/birdshome/archive/2005/03/23/120057.html http://www.cnblogs.com/calmzeal/archive/2006/05/21/405635.html js文件注意: 在一个页面中使用到多个js文件时,编码很重要,js文件的编码不同或者js文件和调用它们的jsp页面的编码不同都可能导致js文件中的方法失效。解决方法:在调用js文件时指定编码方式:<script ...
FCKeditor的分页符在IE和Firefox下面不同: IE:<div style="page-break-after: always"><span style="display: none"> </span></div> Firefox:<div style="page-break-after: always;"><span style="display: none;"> </span></div> 这本没有什么新奇的,但是用String.split()在IE下面可以分割成功,在Firefox下面确不能,追踪半天后才发现奇怪的是Fi ...
http://www.cnblogs.com/njnudt/archive/2008/06/26/1230386.html http://www.cnblogs.com/zhenyulu/archive/2007/02/08/644362.html 1.兼容firefox的剪贴板 createArticle = function(){ var ori = FCKeditorAPI.GetInstance("content").GetXHTML(true); //FCKeditorAPI.GetInstance("content").SetHTML(wellForm ...
超链接中target为: _blank 浏览器会另开一个新窗口显示document.html文档 2._parent 指向父frameset文档 3._self 把文档调入当前页框 4._top 去掉所有页框并用document.html取代frameset 小技巧 1:使别人的页框不能引用你的网页 在文件头加:<base target="_top"> 2:在当前页打开连接或做刷新,提交到当前页 在文件头加:<base target="_self">
模板或者包含文件的修改页面,在里面可以修改已经上传的图片,也可以继续删除图片,修改或者上传后部分刷新该修改页面以显示刚才的修改或者上传。页面可以分为四个部分: A:模板或者包含文件的描写信息,内容等 B:已经上传的图片(需要刷新,为一ifram,id为images) C:上传图片链接 D:隐藏iframe(id为newImage),上传或者修改图片时才显示,完成后关闭并刷新B 1.在D的链接页面里面点击“确定”时关闭D并同时刷新B function confirm(){ parent.getElementById("newImage").style.display = "none"; ...
function autoSize(win){ if (document.getElementById){ if (win && !window.opera){ if (win.contentDocument && win.contentDocument.body.offsetHeight) { win.height = win.contentDocument.body.offsetHeight; } else if(win.Document && win.Document.body.scrollHeight){ win.height = win ...
实现页面无提交刷新
实现三级联动菜单