in .NET you have <%= or <%: in PHP it's echo, but does JavaScript have a shorthand for document.write()?
Thanks
Mark
No, it doesn't.
You can always:
function x (foo) { document.write(foo); }
/* Where x is an unhelpfully short and uninformative function name */
Generally speaking, document.write should be avoided anyway. It is only useful during initial document generation and does nothing to handle special characters.
Yes, more than one.
But "with" is considered harmful because if you make mistake to call a property that is not set you can change the value of another property or create a new global variable with that property ( more info here )
example
var d = document;
d.write('text');
with (document){
write('text');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With