Topic: Innecesary newlines
Hi, this might be one of the most irrelevant features requested on this forum, still is easy and quick.
The current javascript code that gets printed in the HEAD, will automatically add "\n" at the beginning of the print process. Shouldn't that depend on the developer? Some of us like to keep the code very clean, and that also covers blank lines in-between the code.
Code: PHP
<-------- THIS ***
<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
try { if (undefined == xajax.config) xajax.config = {}; } catch (e) { xajax = {}; xajax.config = {}; };
xajax.config.requestURI = 'http://localhost/_template/';
xajax.config.statusMessages = true;
xajax.config.waitCursor = true;
xajax.config.version = 'unknown';
xajax.config.legacy = false;
xajax.config.defaultMode = 'asynchronous';
xajax.config.defaultMethod = 'POST';
/* ]]> */
</script>
<script type='text/javascript' src='http://localhost/_template/lib/xajax/xajax_js/xajax_core.js' charset='UTF-8'></script>
<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
window.setTimeout(
function () {
var scriptExists = false;
try { if (xajax.isLoaded) scriptExists = true; }
catch (e) {}
if (!scriptExists) {
alert('Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?\nURL: http://localhost/_template/lib/xajax/xajax_js/xajax_core.js');
}
},
2000
);
/* ]]> */
</script>
<-------- AND THIS ***
<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
xajax_msg = function() { return xajax.request( { xjxfun: 'msg' }, { parameters: arguments } ); };
/* ]]> */
</script>
I know i can remove the "\n" by myself, but it would be nice to have a compact javascript printed out, instead of that big pile of code. Better yet, an argument could be called that prints the output in a compressed way. For example: