From: p d. t. <pdo...@an...> - 2003-10-04 20:05:24
|
> echo '<script language="javascript" type="text/javascript">' . > "\n<!--\n" > . 'newBody=""; oldBody = document.compose.body.value; for > (i=0; i<oldBody.length; i++) { if (oldBody.charAt(i) == > "\n") newBody+="<br>"; else newBody+=oldBody.charAt(i); > document.compose.body.value=newBody; }' > . "\n// -->\n</script>"; > > If I remove this code, the system loads everything very quickly and > boom, it works. But the down side is that I lose the starting > formatting. > > I have learned that JavaScript and For loops do not work well > together. Is there a way that we can transfer some of the work from > the JavaScript to PHP even if it means outputing additional text to > the browser? You can comment those lines out and put these two lines *inside* of the IF block in the function html_mail_disable_squirrelspell_do() global $body; $body = nl2br($body); The problem with that is that if you have turned on "Use Signature" in your Personal Options, and your sig is more than one line, it will get munched into one line without that javascript solution. Take your pick. I am leaving the javascript solution as default, since if you really want HTML mail, I guess that's the price you pay. My machine is not the fastest in the world (somewhat old, actually) and the delay is not really noticeable except on very large mails. Cheers, Paul |