Select the following code and copy it
My document.write example
This is an example of an HTML file which we might want to write using document write.
It is also an easy way to make a string with HTML, etc. Doing this by hand, can be very difficult because of the various types of quotes used. And the frequent 'un-terminated string' messages. With the doc write wizard it is easy.
See<a href="#" onClick="MyFunction();return false">my alert</a>!
From the main menu, choose Wizards, and Doc Write Wizard. Clear the left hand box and paste the above code in it.
Ignore the warning and continue. Press OK.
The following code is generated:
mystring=mystring+"My document.write example"
mystring=mystring+"This is an example of an HTML file which we might want to write using document write. "
mystring=mystring+"It is also an easy way to make a string with HTML, etc. Doing this by hand, can be very difficult because of the various types of quotes used. And the frequent 'unterminated string' messages. With the doc write wizard it is easy. "
mystring=mystring+"See <a href='#' onClick='MyFunction();return false'>my alert</a>! "
You have created a string very easily even though there are different types of quote to handle. Doing this without the Wizard is not hard, but can be very tedious and frustrating. You can use the string created (mystring) for other purposes when you would delete the document.write(mystring) and edit other parts as necessary.
Click somewhere after the SCRIPT tags (after </SCRIPT>) and type:
"Write a new page"
Select this and choose from the main menu, Wizards and Wizard Function Link. Keep the defaults and click OK.
The following code is added:
<a href="#" onClick="MyDocWriteFunction();return false">Write a new page</a>
Press the Preview tab or F9 to preview the code and click on the link to view the alert.
sometimes (usually) cause problems when it is put in the Doc Write Wizard. Try to get this
code to work when you put the <!--// etc tags in!
If you do, enter the line number in the box next to the 'finger down' symbol and press return. You will go the the line number indicated. This is only a demonstration of going to a line number. Do not expect an easy solution!
Next: Using the knowledge base