spellcheck.js
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:1k
- var origMeth;
- var origAction;
- var origTarget;
- function popIt() {
- if (browser.isNS6up || browser.isIE5up) {
- var n = window.open('about:blank', 'formwin', 'toolbar=no,menubar=no,scrollbars=yes,height=100,width=500,status=no');
- return true;
- } else {
- alert('Spell Checker is only supported in Netscape 6.0+ and IE 5.0+');
- return false;
- }
- }
-
- function spellCheck(frm, e, prefix) {
- var retVal = popIt();
- if (retVal == true) {
- // quick rewrite form values, submit form to spell check, and
- // write old values back to form.
- var rFrm = document.getElementById(frm);
- origMeth = rFrm.method;
- origAction = rFrm.action;
- origTarget = rFrm.target;
- rFrm.method = 'POST';
- rFrm.action = prefix + 'spell/compose.spell.php?f=' + frm + '&e=' + e ;
- rFrm.target = 'formwin';
- rFrm.submit();
- rFrm.method = origMeth;
- rFrm.action = origAction;
- rFrm.target = origTarget;
- }
- }