IT Community - Software Programming, Web Development and Technical Support

how to rectify java script runtime error

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...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-01-2007, 10:16 PM
vel.m8 vel.m8 is offline
D-Web Trainee
 
Join Date: Oct 2007
Posts: 4
vel.m8 is on a distinguished road
Default how to rectify java script runtime error

how to rectify java script runtime error
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-04-2007, 09:42 PM
KiruthikaSambandam KiruthikaSambandam is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 332
KiruthikaSambandam is on a distinguished road
Default Re: how to rectify java script runtime error

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -7. The time now is 09:17 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0