Jump to content

new to javascript... need help.


Pyro_854

Recommended Posts

I'm trying to insert styles and images with javascript, but it's not working.I checked my javascript console and this is what it says:Error: missing ) after argument listSource File: file:///D:/Web/under-the-keyboard/style.jsLine: 1, Column: 27Source Code:document.write("<link rel="stylesheet" type="text/css" href="utk-s1.css">")Error: missing ) after argument listSource File: file:///D:/Web/under-the-keyboard/logo.jsLine: 1, Column: 26Source Code:document.write("<img src="utk-logo.png" width="950" height="200">")Here is the html

<html> <head>  <script src="style.js">  </script>  <title>   Under the Keyboard  </title> </head> <body>  <table border="1">   <tr>    <td colspan="3" width="1000" height="200">     <script src="logo.js">     </script>    </td>   </tr>

Yes my tags are properly closed... it works without the javascript.

Link to comment
Share on other sites

It looks like a quote problem, you must nest your quotes properlyincorrectdocument.write("<img src="utk-logo.png" width="950" height="200">")correct (see the single quotes)document.write('<img src="utk-logo.png" width="950" height="200">');Change that on both the problem lines of code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...