/****** DWR is set to synchronize. In the callback function, you can operate the main function variable and set it to asynchronous. Then, you can ***/dwrengine. setasync (false);/****** use the splice (index location, quantity) method to remove the elements in the array ******/options. splice (I, 1);/****** obtain the scroll height of the vertical scroll bar. The horizontal scroll bar is similar to ******/function getscrolltop () {var scrolltop = 0; if(document.documentelement&document.doc umentelement. scrolltop) {scrolltop=document.doc umentelement. scrolltop;} else if (document. body) {scrolltop = document. body. scrolltop;} return scrolltop;}/****** IFRAME height automatically adapts to begin *****/function reinitiframe (_ IFRAME) {var IFRAME = document. getelementbyid (_ IFRAME); try {var bheight = iframe.content+doc ument. body. scrollheight; var dheight = iframe.content?#document.doc umentelement. scrollheight; var Height = math. max (bheight, dheight); IFRAME. height = height;} catch (Ex) {}}< IFRAME id = "frame_edit" name = "_ edit" src = "" scrolling = "no" frameborder = "0" onLoad = "this. height = 100 "width =" 100% "> </iframe> <SCRIPT type =" text/JavaScript "> window. setinterval ("reinitiframe ('frame _ edit')", 200); </SCRIPT>/****** IFRAME automatically adapts to end ******/
Style. display is compatible with the writing methods of IE and ff. Document. getelementbyid ("test "). style. display = "Block"; // iedocument. getelementbyid ("test "). style. display = "table-row"; // compatible Statement of FF: document. getelementbyid ("test "). style. display = document. all? "Block": "table-row"; document. getelementbyid ("test"). style. Display = "";
/* Obtain the value of radio by name */function getradiovalue (rname) {var es = Document. getelementsbyname (rname); If (ES & es! = NULL) {for (VAR I = 0; I <es. length; I ++) {If (ES [I]. checked) return es [I]. value ;}} return NULL ;}// regular expression, matching <SCRIPT> </SCRIPT> var regscript = new Regexp ("<[\ s] *? Script [^>] *?> [\ S] *? <[\ S] *? \/[\ S] *? Script [\ s] *?> "," Gi "); // regular expression, matching <style> </style> var regstyle = new Regexp (" <[\ s] *? Style [^>] *?> [\ S] *? <[\ S] *? \/[\ S] *? Style [\ s] *?> "," Gi "); // regular, match all tags, such as: <p> var reglabel = new Regexp (" <[^>] +> ", "Gi"); // regular expression, matching spaces, line breaks, and other var regspace = new Regexp ("[\ n | \ r |\\ T | & nbsp;] "," Gi ");/* convert HTML to plain text (clear HTML Tag code) */function html2text (value) {If (value =" ") return value; value = value. replace (regscript, ""); value = value. replace (regstyle, ""); value = value. replace (reglabel, ""); value = value. replace (regspace, ""); return value ;}