|
Sunday, December 6. 2009
When running Javascript, one will normally encounter problems such as getting an error message or the script running but not what you intended it to do. The first thing you can do is to go back to your code to trace for errors.
Javascript error 1: Mismatched braces
Javascript commands are run as a block, which is why in Javascript programming the commands are kept in braces. For every { brace used, there should be a } brace. Additionally, in programming, you will have statements and loops that are nested within one another. This leads to confusion or difficulty in tracking the { braces that will need the corresponding } braces, especially if several blocks end at the same time.
Javascript programming error 2: Mismatched quotes or apostrophes
The usual programmer oversight is when a closing apostrophe is left out or an open quote lacks the corresponding closing quote. Another possible cause for error is when the text contains an actual apostrophe and you forgot to escape it with a backslash. Without the escape, the apostrophe will be treated as the end of the text instead of being within it.
Javascript language error 3: Missing semi-colon
There is also the common Javascript error of the missing semi-colon. This is a syntax error wherein the programmer forgets to put a semi-colon at the end of each statement.
Sunday, April 8. 2007
In the history of the world, there have been numerous bloodsheds which have its roots on basic communication barriers that people were not able to fully jump across. Worst are the wars that have been fought just because of either a minor misunderstanding, or typographical errors on important documents! I think we even have had to bomb a few places in the world just because our genius decoders seemed to have made some mistakes on deciphering the codes stealthily extracted from the "enemy"! Well, since you just can't teach an old dog a new set of tricks, such problems have arisen as well on digital information platforms!
There are many problems which arise from XHTML developed web documents and the actual use of various web design and development languages. You see, surrounding the scripts on the XHTML developed pages of an internet site with comments have been seen to have minor problems pop up here and there. But, what's even worse is for you to include double dashes on your scripts which have comments that surround it! Specially if the errors on your codes are done on XHTML developed web documents!
Not carefully looking out for such a mistake would generally provide you with either a fuming mad web publisher, a ton of hatemails from your internet site's viewers, or a fistfight with your web designer superiors! Specially if your superiors worked on the codes, and you just seemed to mess up the entire internet site with such an error! Don't say I didn't warn you when you either lose your investment, lose your job, or lose your teeth!
Monday, April 2. 2007
 In the non-digital and the non-electronic world, the word universal seems to have no meaning whatsoever. I don't get it, but with digital and electronic platforms, mathematical perfection can be attained! But why the impossibility of universality in these platforms? Aren't these platforms a true representation of a fully functional mathematical world? Can't the necessary improvements be made on the digital information platform so as to be universal?
Well, I think the main reason for the impossibility of universality in these electronic and digital platforms are the human programmers and developers themselves. They tend to develop programs that does not seem to work seamlessly with other programs, more so in other platforms! Plus, these developers usually create additional scripts, codes, etc. to sort the mess up quite a bit, but end up messing it more! With this, I give you a prime example below.
If you have noticed with your non-mathematical perception, which I see as an impossibility, too, given the circumstances, the inconsistencies and discrepancies in using scripts done through JavaScript programming in XHTML developed web documents, you may very well understand what I mean by the human programmers and developers being the primary reason behind the impossibility of universality in the digital platform called cyberspace. This is because there are certain characters, strings, and values used in JavaScript programming which would not be able to exist, more so work well, in XHTML developed web documents. You see, the developers of XHTML has released a new version of the web development language, and this change in format is causing problems to pop up with the rest of the web development languages. I don't know why they did that even when they knew that it would cause problems! If they said they didn't know, then they're trying to pull your leg with that one, mate! How can they not know of something that is virtually inevitable? With the solution to this problem, stay tuned for the latest developments on JavaScript programming. For this is how it usually works: a programmer does something stupid, another one does something to fix the mess, and the other does another stupid blunder!
Saturday, March 10. 2007
In the world of digital information technology, we are reminded how much human we all are. Yes, we all commit mistakes now and again, but in things as high-tech as an HDTV's program tuning requirements, we are all newbies at one time or another. Plus, with even harder concepts such as JavaScript programming, chances are we're all dimwits. Well, at least most of us are, while some of them aren't that bad, while a select few are very good at it.
Now comes the part wherein we handle the errors in JavaScript codes. No, we don't handle the errors manually, you know. They are handled by the program compiler itself, and it's just up to us to decide on which steps to take and which things to do. Don't be fooled, though, for we write and develop the codes ourselves. With this, did you know there are 2 basic error handling levels in JavaScript? Yes, there are, in which I would want to discuss the simpler level.
Now the simplest level of error management or handling found in JavaScript is called syntax errors. These errors occur even before the to-be-compiled JavaScript coding sequence runs. This would tell the JavaScript programmer that the script cannot be compiled. The normal reasons for this occurrence are incomplete codes and misspelled codes. Thus, syntax errors are pretty much easy to handle. Yes, both for you and the compiler!
Friday, February 16. 2007
 Not only are typographical errors in your JavaScript codes catastrophic, but so are declaring variables twice and missing the fact that JavaScript programming is case sensitive. This would result in a non-working script, or even an improperly functioning JavaScript on your website! Having one on your website is like bringing a laptop with wireless connectivity in a hacker and virus programmer get-together party!
These are some of the most common errors, and it is actually harder not to miss! But, just like the error notices you get with typos in your JavaScript codes, you also get them on improperly done codes. Yet, oftentimes, too, the JavaScript codes with twice declared variables and wrongful capitalizations run improperly, thus wreaking havoc on your website or your applications.
What is even worse is for your applications with JavaScript to run the way you did not expect it to! This would evidently result in long hours of deciphering which codes to modify and which to retain. For improperly spelled codes do not run at all, improper case input and declaring twice a variable that is only meant once would be like hell loose on Earth, or, on your website and your applications! Present high-tech information technologies do not yet have a scanner in which to detect such errors in your JavaScript codes, and I don't think there will ever come a time in which there would be one! You could prove me wrong by spotting the errors the codes below have. So keep your eyes open for those improperly declared variables and those case sensitive codes.
< - start of code - >
VAR _serviceurl;
this.get_serviceURL = function() {
return _serviceURL;
}
this.set_serviceURL = function(value) {
_serviceURL = value;
_serviceURL = value;
}
< - end of cod - >
Thursday, February 15. 2007
Web designers should always keep in mind to design and develop the pages on their websites in the most navigable and accessible way possible. One way to do this is including a built-in search engine on your website by using JavaScript programming. This search engine should always be simple to use and efficient, and, apart from the search engine itself being functional, the data contained by your website should also be organized and catalogued for fast future searches by page viewers.
Some websites lack a built-in search engine, and this is very frustrating for internet surfers who want to maximize their time on the net. Websites should keep pace with the advancements of electronic information technology, which makes connections faster, more accurate, and efficient. But if there isn't a search engine on your site, you deny viewers of the advancements and convenience technology brings!
So, the requirements in developing a usable and easy to use search engine is basic JavaScript programming knowledge, apart from database management. When designing and developing one, it should be as simple as it should be - fully accessible even to a toddler! It should always contain a simple search box, and it is your choice to include an advanced search option as well, but the simple search format should never be forgotten, for advanced searches usually have too much options, and these options tend to confuse viewers who just want to type a keyword in and then press enter!
Thursday, February 8. 2007
 I bet you, just like me and the rest of humanity, sometimes miss minor details such as misspelled variables and thus end up with a non-working script. In javascript programming, a misspelled variable usually results in, if not errors on some of the functions of the script, a non-working script at all. At least I have come to know of a way in which I could easily navigate to the problem code, and thus know the nature of the problem, thus making it easier for me to correct the problem.
But if you didn't know this, I bet you have had your fair share of hair-tearing days wherein you thought you just had to rewrite the whole damn script - from top to bottom! No, you need not check on high-tech electronic equipment to ease your troubles a bit with those javascript codes, you know. You just have to hold on to your sanity, and started reading through the error messages which usually pops up when you've done something wrong with your script.
This is how it should go, at least for me, that is: an error on a javascript would cause an error message to pop up. Just read through the message, and you'd be able to locate the problem along with the nature of the problem - and if knowing is half the battle, and pinpointing the logistics of the enemy is the other half of it, then a demigod are you when it comes to javascript programming! With this, you'd be able to relax a bit, and maybe even treat yourself to a blockbuster flick at your nearest moviehouse!
Saturday, December 30. 2006
Because of the name, JavaScript can sometimes be confused with Java. Although their names are similar, they almost have no connection with each other at all. Perhaps the only real relationship between JavaScript and Java, besides the name, is their syntax. However, their semantics, especially their objects models, are very different. Java is an advanced programming language while JavaScript is a scripting language. JavaScript is a source code embedded in the HTML page to operate the elements of the page.
Although JavaScript is loosely based on the Java programming language, they are not alike in any way. JavaScript programs are contained in the HTML code of a web page, so once you access the page you also access the JavaScript program. Meanwhile, Java is a platform independent and is downloaded separately from an HTLM page. Java, when launched from a webpage is called an applet. When a program independent from the web is used, the Java program is called an application and when used on a web sever it is called a servelet. Now that you know the difference, I hope you won’t confuse the two together again.
Friday, December 15. 2006
 Some JavaScript errors are caused by incompatibility to web browsers. In the nineties when the Internet was still young, the development of webpage browsers grew at a fast rate and unfortunately, without standards. This caused the need to sniff and see which type of browser was used. Thankfully, there are known recommendations for both script [ECMA] and DOM [w3.org] to help ease the problem. But there recommendations don’t always help. Some are vague and are implemented differently based on what browser is being used.
The Microsoft Internet Explorer has other properties in addition to those in the DOM model but for some reason, even though codes have valid html construct the Windows IE does not like to nest smart forms in its definition list. It is recommended to avoid the use of the features of the Windows IE such as filters and transitions because it only works in the said browser. An example of a useless DOM recommendation that causes a problem in IE is the sequence of actions when both focus and blur occur at the same time. Here is a sample code that tries to insure that a field is not empty as soon as you move to the next field but the IE leads it to an endless loop.
<! - sample code - !>
<script type="text/javascript">
function requiredString (control, label) {
if (control.value.length == 0)
{alert("you need to enter a string for "+label); control.focus();}
} </script>
. . .
<input name="Control1" onBlur="requiredString (this, 'Label1');">
<input name="Control2" onBlur="requiredString (this, 'Label2');">
<! - end sample - !>
</textarea>
Thursday, December 14. 2006
 Just like in writing, a simple syntax error has negative effects in running a JavaScript on your website. The only difference between the two is when a writer forgets to place a period at the end of his sentence; his readers will still understand what he wants to say. In the formulation of a JavaScript code, a missing comma or a brace can break your whole page. To err is human but that doesn’t excuse you from committing the same mistakes over and over again, here are some of the few common JavaScript mistakes.
Unlike writing in the Microsoft Word processor, there are no spell checkers to help you debug you code. You have to check every word and make sure that they are formatted correctly. Keep in mind the proper letters that needs to be capitalized. Closing a code is also a common error. Check the curly braces, parentheses, and quotation marks carefully. Make sure you close an IF statements, functions. In closing strings, be consistent. Close with the same type of quotation mark you used when opening a string. Don’t use reserved word. They’re already part of the language’s syntax so there’s no need to include them in your code.
|
|
Comments