JS document.writeln problem
I have a simple question, but I can't find a answer to it.
Thank you, for your help
Firstly, avoid document.write(ln). It's old, old, old. Create an HTML element (span or div or something), give it an ID, and use innerHTML (or jQuery .html()) to populate it after it's created.
Secondly, the // at the beginning of the line is commenting out that line. Remove that, and the line should be enabled. But, again, refer to my "Firstly" comment.
If the double-slash is preceeding it, no. It's commented out, the browser does not parse it.
If you need to set it so that it triggers on a button click or link click, place that inside a function and call the function using onclick="" attribute. But, then, that brings us back to the "Firstly" comment. document.write and document.writeln both will rewrite the whole page if executed after the page loads.
|All times are GMT +1. The time now is 12:37 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.