Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentClient Side ScriptingJavaScript right
left right
Pixeltor
post Oct 6 2010, 11:47 PM
Post #1


Member
**

Group: Members
Posts: 99
Joined: 14-November 08
From: New Brunswick, Canada
Member No.: 68,991



Am I missing something here?

CODE
<!DOCTYPE html>
<html>
&lt;script type="text/javascript" src="javacode2.js">
</script>
<head>
<title>
yeah
</title>
</head>
<body>
<span id="test"></span>
test

</body>
</html>


javacode2.js
CODE

var span = document.getElementById('test');
span.innerHTML = 'why wont this crap work?';


Opera's handy developer's tool tells me this:

Uncaught exception: TypeError: Cannot convert 'span' to object

Error thrown at line 3, column 0 in file://localhost/G:/Documents/javacode2.js:
span.innerHTML = 'why wont this crap work?';

it cant seem to find the span element. Does it matter that this is not uploaded to a site and is instead opened from my pc?
Go to the top of the page 
 
  + Quote Post

Posts in this topic

 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 19th May 2013 - 12:24 PM