404
Archived Posts from this Category
Archived Posts from this Category
Posted by pcfix on 12 Jul 2007 | Tagged as: 404, error, browser, windows, internet
A Javascript error can be handled a few different ways. Most of the time, it is up to the web browser you are using to decide how to handle a Javascript error. Although they usually do a good job of handling the Javascript error, none of them do a good job informing the user of the error or help them get past the error. An error can affect a web page from functioning altogether, so deciding how to handle an error smartly should not be something left to the internet browser alone. Using the window.onerror event, you can deal with Javascript errors in a much better manner when users encounter them while using your Javascript programs.The most commonly supported method for handling Javascript errors is the window.onerror event. You can use this event to tell an internet browser how to handle an error should one be encountered. You can tell the internet browser to run a specific section of your program or code in the event of an error. You may decide to have the internet browser ignore the error, or send the user to a error webpage. It will be your choice as to what is best for your webpages. Besides informing you of syntax errors, the window.onerror event is also an excellent way to deal with errors that occur when the internet browser attempts to display a picture.
Suppressing the Javascript error is a good idea on web pages that do not rely on Javascript to display and operate correctly. For example, if you are using Javascript to make your links change color and shape when the mouse is placed on them, then it is not necessary to display an annoying error message if this feature is not working. You will just be likely to annoy the webpage visitor causing them to leave your web site. To suppress Javascript errors, just write a function that does nothing and point the internet browser to this code each time an error event occurs. If your webpage needs Javascript to run properly, this is not going to do any good.
The easiest way to deal with a Javascript error is to redirect the web site visitor to an error page similar to a 404 error page. This will allow you to display a descriptive error code for the user, or suggest alternate locations on your site that they can find the information they are looking for. You also may have a simpler HTML web site that you would like to redirect the visitor to if they are having trouble with your more interactive Javascript version. No matter what you decide to do, be sure that you thoroughly test your code and error handling functions. To do this, you may want to intentionally make an error in the main part of your Javascript program so that you can test its error handling abilities.
Posted by pcfix on 12 Jul 2007 | Tagged as: 404, error, browser, internet explorer, internet
If you receive an HTTP 404 error it means that the web browser was able to connect to the server, but that the server could not find the web page that has been requested or that it was set up to not respond to the request and give no reason why.When communicating with a server using the HTTP protocol, a server must send back a response to any request that it received. If there is an error on finding the web page requested, this response will consist of a numeric error code and a MIME message. These errors can be modified on a web server so that they provide more useful information to the end user. In Internet Explorer, however, these customized error codes will not be displayed to the visitor unless they are more than 512 bytes unless the web browser’s option to show friendly HTTP error messages has been unchecked.
The most common cause of an http 404 error is a web page that has been moved or deleted from a server. If it has been moved, a more useful error code would be a 301 moved permanently error. A server can be set up to display this error code by modifying some configuration files. Because these additional settings have to be inputted into a configuration file, most web servers will just stick to the default error codes.
There are countless different types of http 404 error messages that can be found all over the internet. Some pages will use the default http 404 error messages but there are also basic versions that include a search box for the server you are connected to. A more graphically appealing version is also sometimes used on larger web sites.
There are a few steps that you will need to take if you want to create your own custom http 404 error messages. First off, you will need to create or modify a file by the name of .htaccess. If you add the line “ErrorDocument 404 /notfound.html” then the web browser will display your notfound.html file each time an http 404 error is encountered.
Now that you have the web server set up to use the notfound.html file each time an http 404 error is encountered, the sky is the limit. You can write you very own web page code in the html file to display pretty much anything that you like when the error is encountered. There are a few things that are recommended, however, such as a link back to your home page, a search box for your website and any other tools to help the visitor find what they are looking for.
Like all things, once you have set the custom http 404 error the way you would like it, be sure to run your web server through a few tests to make sure that it displays your custom error page the way you intended it to.