Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1616 How do you generate JavaScript from inside JavaScript?

You are here: irt.org | FAQ | JavaScript | Misc | Q1616 [ previous next ]

Use something like:

<script language="JavaScript"><!--
document.write('<script>');
document.write('alert(\'Hello world\')');
document.write('<\/script>');
//--></script>

Note, that the code is not executed until the JavaScript element that contains the docuemnt.write is ended with a closing script tag.

Feedback on 'Q1616 How do you generate JavaScript from inside JavaScript?'

©2018 Martin Webb