473,395 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Page Not Found

Hey, I have a javascript problem and I can think of two solutions.
First of all the problem. I have a script that dynamically loads pages
in iframes on the fly. Sometimes it is possible that these pages do
not exist. So Mozilla alerts me that the page cannot be found. My
question is can I omit the Alert or throw an exception some how or
test if the page exists before hand

Now to my solutions, if when mozilla cannot find the page it would
also throw an exception so I could test to see if it wasnt loaded so I
could make my own Error report instead of an alert. Or secondly if I
could some how test before hand if the file existed.

Any one care to enlighten me on this subject, Thanks.
Jul 23 '05 #1
5 1989
fc***@ncf.ca (Yvon Kephren) wrote in message news:<86**************************@posting.google. com>...
Hey, I have a javascript problem and I can think of two solutions.
First of all the problem. I have a script that dynamically loads pages
in iframes on the fly. Sometimes it is possible that these pages do
not exist. So Mozilla alerts me that the page cannot be found. My
question is can I omit the Alert or throw an exception some how or
test if the page exists before hand

Now to my solutions, if when mozilla cannot find the page it would
also throw an exception so I could test to see if it wasnt loaded so I
could make my own Error report instead of an alert. Or secondly if I
could some how test before hand if the file existed.

Any one care to enlighten me on this subject, Thanks.


why not use a customized error404-doc, loaded trough .htaccess?
Jul 23 '05 #2
In Mozilla there is no 404 error page. There is just an alert that
states the url of the document cannot be found and the page remains
blank or keeps the content previously on the screen.

My problem is not in Internet Explorer, Souly in Mozilla there is an
alert that I would like to avoid.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
Yvon Kephren wrote:
In Mozilla there is no 404 error page. There is just an alert that
states the url of the document cannot be found and the page remains
blank or keeps the content previously on the screen.

My problem is not in Internet Explorer, Souly in Mozilla there is an
alert that I would like to avoid.


The way to avoid the alert is to have your server not generate 404 HTTP
responses. This is what the original reply to your post is saying.

The way to avoid sending 404 HTTP responses is to have your server
redirect to a 404 error page (handler) so that a 404 is never actually
sent to the browser.

Beyond that, there's little you can do to avoid a dialog box appearing
in a particular user agent at the application level. Client-side
Javascript simply can't do anything about the browser receiving, and
acting on, a 404 HTTP response. However, from my testing Firefox 0.9
does not show an "alert()" style dialog unless the host _can't be found_
(resolved). If it receives a 404 HTTP response, it displays "The
specified page was not found at <host>."

Regardless, there's nothing you can do about an application level dialog
appearing when Firefox/Mozilla can't resolve a hostname using
client-side Javascript.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #4
Thanks for the insightful string. But with that information comes the
next useful question can I detect if the document exists on the fly. If
not an Index will have to do.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #5
Yvon Kephren wrote:
Thanks for the insightful string. But with that information comes the
next useful question can I detect if the document exists on the fly.


Your well-configured Web server does this for you.
PointedEars
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sean Berry | last post by:
Hi there. I am relativly new to Python CGI and need a question answered. I have made custom 404 error pages and have them in various web directories. I have not been able to figure out a way...
13
by: teenzbutler | last post by:
I have a 10mb ASP file, which will not load in IE 6.0. I get an HTTP 500 error. When I convert the 10mb file to HTML, it loads fine. Is there a limitation on file size? If so, is there a tag I...
1
by: Mathieu CARTOIXA | last post by:
Hi all, I am currently developing an application that should be able to print bank accounts histories. As the input data are formatted in XML, the obvious technical solution retained was to use...
7
by: Brian Paul | last post by:
When a user clicks on a linkbutton on a page, i would like to render a printer-friendly version of the asp.net page and download it as an html attachment to the browser. The code below works great,...
2
by: ypul | last post by:
on my local server i am getting ".net error" of "page not found " but on my hosting server I am not getting .net error ...I am getting the normal page not found error what could be the reason ?...
1
by: sam | last post by:
Hi, I have seen many posts about this problem and no resolution. I have set the maxRequestLength to 200K as I don't want anyone uploading files to the server greater than this size. I have...
7
by: Pat Carden | last post by:
I'm trying to provide a better user experience by redirecting my users to a "Page Not Found" page, using a Custom Errors directive in Web.Config. The problem is I need to return a 404 error code...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code behind. However, when I set a breakpoint there and...
13
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.