I want to write a js variable inside a function to a web page.
test.js
try_picture();
function try_picture() {
var picture = '<tr><td colspan=2 align=right><fo nt size=2>Picture
5:& nbsp;</font></td><td colspan=2><inpu t type=file size=68
name="picture5" ></td></tr>';
}
HTML
This is part of a table.
<script language="javas cript"
type="text/javascript">doc ument.write(pic ture);</script>
If I remove the function command, the picture is written into the HTML. The
function is the problem.
I have tried try_picture(pic ture) and function try_picture(pic ture). It did
not work.
I would appreciate any suggestions.
I am missing something.
Ken
test.js
try_picture();
function try_picture() {
var picture = '<tr><td colspan=2 align=right><fo nt size=2>Picture
5:& nbsp;</font></td><td colspan=2><inpu t type=file size=68
name="picture5" ></td></tr>';
}
HTML
This is part of a table.
<script language="javas cript"
type="text/javascript">doc ument.write(pic ture);</script>
If I remove the function command, the picture is written into the HTML. The
function is the problem.
I have tried try_picture(pic ture) and function try_picture(pic ture). It did
not work.
I would appreciate any suggestions.
I am missing something.
Ken
Comment