Test your skills
In using a Java Script application, how do I overcome the document.write() bug that surfaces in NS 3?
The java script command document.write() is used to display or print something on the page using java script. The problem you encountered regarding this command depends on what kind of error it generates. It would be helpful if you attached a screenshot of the error message you received. Maybe the error you received has something to do with the right syntax of the command. Check the command in your page if it is entered properly.
To display a message using this command, the text message should be place inside the parenthesis () and should be enclosed with single quotes ‘’. For example, to display the message, Hello every one, you need to code it as: document.write(‘Hello every one’). Here is the complete java code for this.
document.write(‘Hello every one’)
If you want to display a link using this java command, here’s the proper coding. For example, to display the link <a href=”http://www.google.com”>Official Google Website</a>:
document.write(‘<a href=’+’”’+’http://www.google.com’+’”’+’>Official Google Website</a>’)