Menu
I am a new programmer/web developer. I have been doing this about 2 months. OMG this stuff is so frustrating. Html and css were cake. javascript is tough though! The concepts are easy enough but I cant do anything with out a reference book! i feel like nothing works for me and all my scripts are worthless. Does it get easier?
Was your first programming language tough?
is programming frustrating for you?
Until i get better i am going to be using this forum a lot. I would appreciate any help i can get on debugging my scripts. I am sure all of them will be relatively easy for whoever is reading this.
<i>
</i>...
<div style="width:50px;height:50px;background:#CC0000">&nbsp;</div>
<input type="button" value="Change bgcolor">
...
<i>
</i><div id="mydiv" style="width:50px;height:50px;background:#CC0000">&nbsp;</div>
<i>
</i><script type="text/javascript">
var myElement=document.getElementById('mydiv');
</script>
<i>
</i><script type="text/javascript">
var myElement=document.getElementById('mydiv');
myElement.style.background='#00FF00';
</script>
<i>
</i><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function myFunction(){
var myElement=document.getElementById('mydiv');
myElement.style.background='#00FF00';
}
</script>
</head>
<body>
<div id="mydiv" style="width:50px;height:50px;background:#CC0000">&nbsp;</div>
<input type="button" value="Change bgcolor" onclick="myFunction()">
</body>
</html>
I am finding it extremely frustrating.
Thing the biggest reason for this is examples I am looking at don't always explain exactly what is going on and why at points throughout the code.
I've got the feeling I'm never going to get above cutting and pasting at this rate![/QUOTE]
<i>
</i><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function myFunction(id,col){
var myElement=document.getElementById(id);
myElement.style.background=col;
}
</script>
</head>
<body>
<div id="mydiv1" style="width:50px;height:50px;background:#CC0000">&nbsp;</div>
<input type="button" value="Change bgcolor" onclick="myFunction('mydiv1','#00FF00')">
<br><br>
<div id="mydiv2" style="width:50px;height:50px;background:#0000CC">&nbsp;</div>
<input type="button" value="Change bgcolor" onclick="myFunction('mydiv2','#FF00FF')">
</body>
</html>
IMHO, the difficult part for most people is not the programming itself. It is the logic. Anyone can set a value, create a loop, create a function, etc.
But, the real difficulty is in determining where to create a loop, a function or where to set a variable. Some "best practices" can be taught. For example, if you need a boolean variable (on/off), you should almost never (with few exceptions) actually set a string as "on" or "off" - instead use true & false. But, "real" logic is not something I believe can be taught.
I know a lot of good web designers that can do programming, and I know a lot of good programmers that can do design. But a good programmer who is also a good designer is a very rare breed. basically the difference between right-brained and left-brained people.[/QUOTE]
0.1.9 — BETA 5.22