This is a discussion on how to rectify java script runtime error within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; how to rectify java script runtime error...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, Most internet users have encountered the annoying JavaScript error at some stage. This happens when a script in a web page contains an error or fails to execute correctly. Exactly what happens depends on the browser and type of error, but in most cases some sort of error notification will be displayed. In Internet Explorer's default setting, a small warning icon appears in the status bar. Double-click this icon to display a window with the complete error message. You can see the complete error message . You can choose to have this error window appear automatically whenever an error occurs. This could be annoying for general surfing, but it is very useful when writing your own JavaScript. This is because the error message always lets you know when something is wrong with your code, and even better, it usually tells you exactly where in the HTML document the problem lies If you are visiting a website which shows an error, you obviously can't fix it but if you're feeling generous you might like to contact the webmaster and let them know. You can still view the page (disabling automatic error messages will make it easier), but whatever the script was supposed to do won't work. This may or may not effect on the functionality of the page. Fixing JavaScript Errors There are two types of JavaScript error: * Syntax Error: Occurs when there is a mistake in the way the code is written; for example, a typo or missing character. * Runtime error: Occurs when the script is unable to complete its instructions; for example, if a specified object cannot be found. Example Syntax Error The function below contains an error and will result in the error message as pictured. In this case the message tells you that a closing parenthesis is missing. function showText() { alert('something!'; } Runtime Error The function below is constructed correctly and will run with no problems as long as the variable something can be found (remember that a text string without quotes is assumed to be a variable). If this variable is not defined an error will occur. function showText2() { alert(something); } Syntax error messages appear as soon as the page loads, even if the error is inside a function. Runtime error messages appear when the affected code runs, so if an error is inside a function the message will appear when that function is executed. Thx Krthika |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/html-css-javascript-coding-techniques/4351-how-rectify-java-script-runtime-error.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 11-05-2007 12:29 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java without runtime? | STARGAZER | Java Programming | 1 | 12-28-2007 11:29 PM |
| script error: 800A01AD | amansundar | Mobile Software Development | 4 | 12-20-2007 02:17 AM |
| Microsoft JScript runtime error: 'offsetTop' is null or not an object | vel.m8 | HTML, CSS and Javascript Coding Techniques | 0 | 11-01-2007 10:52 PM |
| Can an html and Java script be separated and the script placed in the cgi-bin? | Pvinothkumar | HTML, CSS and Javascript Coding Techniques | 1 | 09-13-2007 06:11 AM |
| Error in running perl script on netscape on WinNT. | vadivelanvaidyanathan | Perl | 0 | 08-08-2007 12:40 AM |