 |
| Javascript How-To Ask your "How do I do this with Javascript?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 9th, 2009, 03:36 PM
|
|
Authorized User
|
|
Join Date: Dec 2009
Posts: 13
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Encouragement?
Hey....
I'm enrolled in a web database development program. So far, I've gone through HTML & CSS and understood it quite readily and found it very interesting and fun to play around with.
Now....JAVASCRIPT.....!!!!
I have gone through the intro chapters in the course program and chapters 1, 2 & 3 in the WROX book "Javascript for beginners" 3rd edition. Whoa....I feel totally lost.
Here's my question....will this ever make sense to me? I believe I'm pretty intelligent, but this javascript thing seems very complex. Any insight or encouragement would be greatly appreciated. Thanks.
CC 
|
|

December 10th, 2009, 04:09 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you already made some progress since you posted it? ;-)
JavaScript may seem complex at first especially in programming book as they have to a) teach you a lot and b) have to be technically acurate and complete.
However, in practice (depending of course on how you're going to use it) you'll find that many things are not that complex....
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

December 10th, 2009, 08:28 PM
|
|
Authorized User
|
|
Join Date: Dec 2009
Posts: 13
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Thanks Imar
I really was maticulous in my studies today. Taking detailed notes in a spreadsheet and testing each process using separate htm documents. I'm getting there, but I have had to go through the basic concepts of javascript using 3 different text books....each time going through the material a little slower and with more purpose.
I had a reknowned professor tell me that javascript is difficult to learn if it is your first programming language (for me it is). He said learning a more traditional language like C++ first might be the way to go. What do you think?
CC
|
|

December 11th, 2009, 12:18 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
I think that anyone who believes learning C++ is easier than JavaScript to be mistaken. It may be easier to learn C# or Java but the memory management in non-garbage collected languages is very arduous and error-prone.
You may just need to start writing stuff and get a feel for it. You can do lots in simple scripts, see if you can get a test harness going whereby you can easily write some code and run it in a simple page.
|
|
The Following User Says Thank You to joefawcett For This Useful Post:
|
|
|

December 12th, 2009, 06:55 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I agree with Joe. IMO, C is more difficult to learn than JavaScript.
What I like about teaching JavaScript to people is that it gets practical quite quickly. With only a few understood concepts you can already start doing fun stuff in the browser. This makes it easier to understand what your code does and how it worksare, aiding in understanding the language, motivating you to learn more.....
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

December 14th, 2009, 10:45 AM
|
|
Authorized User
|
|
Join Date: Dec 2009
Posts: 13
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Thanks Joe & Imar...
Well it's back to the books this morning. I'm hoping that my maticulous notes and purpose is going to pay off this week. I am determined to not just "go through" this material, but to truly understand it. Imar....I noticed your book is on ASP.NET...being that I am enrolled in a web developer program...where does asp.net fit in?
Thanks again for the encouragement. I hope to be telling you soon that the javascript concepts are falling into place.
CC
|
|

December 14th, 2009, 01:32 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
You may want to take a look here and see if the book is anything for you: http://www.wrox.com/WileyCDA/WroxTit...47018759X.html
ASP.NET is for a large part about the server side of web development. E.g. dynamic page generation, interaction with databases, user management and much more. Check out the book's TOC for the full topic list. Besides server side stuff the book also introduces you to client concepts such as HTML, CSS, JavaScript, and AJAX.
Is there a server part in your " web developer program"? Does it touch on ASP.NET? Or is it teaching you some other server side technology such as PHP or JSP?
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

December 21st, 2009, 03:04 PM
|
|
Authorized User
|
|
Join Date: Dec 2009
Posts: 13
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Thanks Imar,
I'm still plugging away at this javascript stuff. To answer your question, yes the course I'm enrolled in does include instruction on the server side tech. It is later in the course. So far I have learned about design specs, html, css, and now javascript. I have a good handle on html and css...but the javascript is difficult. I have been accessing various tutorials around the web. I refuse to move on without a full understanding of javascript. Today I've been working on a small script that does a calculation based on user input.
I thought what might really help me is to color code each part of the code and define what each part does using something like a map key.
It is helping me a bit, but I am having difficulty actually identifying each component. Do you know of a resource that actually shows some javascript code that is diagrammed? For example:
var myVariable = 0
There are 4 javascript components above: (variable, name of variable, assignment operator, and value).
Do you know of any resource that might break the javascript down in this way? It might seem like a crude learning method, but I think it would help me understand much better. Here is the code I am working on color coding:
Code:
<HTML>
<HEAD>
<TITLE>Exercise 5.3 Part 2</TITLE>
<SCRIPT TYPE="text/javascript">
function calculate(form,currentField) {
if (currentField == "square") {
form.entry.value = Math.sqrt(form.square.value);
form.twice.value = form.entry.value * 2;
} else if (currentField == "twice") {
form.entry.value = form.twice.value / 2;
form.square.value = form.entry.value * form.entry.value;
} else {
form.twice.value = form.entry.value * 2;
form.square.value = form.entry.value * form.entry.value;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD="POST">
Value: <INPUT TYPE="text" NAME="entry" VALUE="0"
onChange="calculate(this.form,'entry');" />
Double: <INPUT TYPE="text" NAME="twice" VALUE="0"
onChange="calculate(this.form,'twice');" />
Square: <INPUT TYPE="text" NAME="square" VALUE="0"
onChange="calculate(this.form,'square');" />
</FORM>
</BODY>
</HTML>
Any help would be greatly appreciated. Thanks again!
CC
Last edited by cc9of13; December 21st, 2009 at 03:06 PM..
|
|

December 21st, 2009, 03:38 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
What editor do you use to write your JavaScript code in? Visual Web Developer / Visual Studio has syntax coloring, although not for every individual piece of code.
There are other editors available as well, some free, some paid.
- Notepad++ ( http://notepad-plus.sourceforge.net/uk/site.htm)
- Edit Plus ( http://www.editplus.com/)
- Crimson Editor ( http://www.crimsoneditor.com/)
- Dreamweaver (adobe.com)
- Many many many more....
Imar
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Encouragement? |
cc9of13 |
Javascript |
1 |
January 14th, 2010 03:58 PM |
| Encouragement? |
cc9of13 |
BOOK: JavaScript Programmer's Reference |
4 |
December 9th, 2009 05:51 PM |
| Encouragement? |
cc9of13 |
BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 |
0 |
December 9th, 2009 03:32 PM |
|
 |