Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.writeln()

Status
Not open for further replies.

hiyatran

Technical User
Aug 7, 2010
21
CA
I'm sorry if this question seem very basic but I just start learning javascript. I would like to display an image but not sure why it is not working. In a nutshell, here's my code

Code:
<html>
<head></head>
<body>

<script type="text/javascript">
document.writeln("<img src=/"xMark.jpg /" width=25 height=25 >");
</script>

</body>
</html>

 
Your quote escaping is wrong.

This should have shown up as an error. If you are using IE click on the yellow shield icon on the bottom left to see any errors in your code. If you are using FF, use its Error console from the Tools Menu.

try this:

Code:
document.writeln("<img src=[red]\[/red]"xMark.jpg [red]\red]" width=25 height=25 >");



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top