I have never worked with Javascript before so I was a little nervous on Wednesday when it was expected that we knew at least a little about it. Once we started doing the work from the textbook it actually seemed fairly simple. Not exactly simple, but not too much different from any of the other code that we are used to writing. I say that I thought it seemed simple because for some reason I could not get my page to work right. I gave up that day and decided I would go back with fresh eyes another day. Well today was the day and I was so lost in code I could not figure out what I was doing wrong. Finally, I realized that when writing the getDetails function I only put on equal sign instead of two in the null request. I couldn't believe that such a small error could cause an entire page to do nothing.
I did some searching on the internet and found a five page article on common Javascript errors. I thought that this might help some of us out because I am not sure how many people have actually worked with Javascript extensively. I also went through a portion of the tutorial at W3Schools online that Ivaylo mentioned in his first bog. It gave me a little more understanding, although some of the stuff I did already know just forgot because it has been a little while since I did any kind of web pages or code. In case anyone doesn't know what the difference is between one equal sign and two, tizag states "A single equal sign sets a value while a double equal sign (==) compares two values". This is a huge difference if your trying to tell the server to make sure the request isn't null and telling the server it is null.
I hope that as the semester goes on I will get a better understanding of browser side scripting like Javascript and AJAX as well as PHP server side scripting. I am sure though that it is the same as anything else, the more practice you get the better your understanding.
Sep 25, 2009
Subscribe to:
Post Comments (Atom)
Michelle, I think that JavaScript is quit different from other code, at least structured code, and when you add it to XHTML and CSS it can be quite interesting. It does knid of remind me of Perl though.
ReplyDeleteI like your post, mainly because as yourself, I have never used JavaScript and I skimmed through the 1st two chapters. It doesn't really seem that hard but it's not easy. I'm planning to go and look at online tutorials on www.w3schools.com Drake told me that it's pretty helpful. I hope this semester ends up on good.
ReplyDeleteHey Michelle,
ReplyDeleteThanks a lot for that post. I have experienced what you wrote. I just forgot some small signs and the browser had not started the Script.
I wrote the script in Notepad++ because it features syntax highlighting, though it does not check the code for syntax errors.
So I tried the JavaScript plug-in for my eclipse, my favorite development environment. This does check your code but, I don’t understand why, it indicates methods (“new ActiveXObject” and so on) as not correct.
At the moment, I am looking for an editor that does support syntax highlighting as well as code-debugging. Maybe someone has some suggestions?