473,395 Members | 1,670 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.

javascript, frames and opening files

I am getting a filename from one frame and opening it in another frame. It
works fine if the file exists, but I'm trying to get it to show an error
message, possibly an alert box, if the file doesn't exist. Right now, if it
doesn't exist it just gives a error "page not found" in the frame I'm trying
to open it in. Here is my code.

function PullPage()
{
for (var i=0; i<document.Page.Letter.length; i++) {
if (document.Page.Letter[i].checked){
var FirstLetter=document.Page.Letter[i].value}}
for (var j=0; j<document.Page.Artist.length; j++) {
if (document.Page.Artist[j].checked){
var SecondLetter=document.Page.Artist[j].value}}
var OpenMe=FirstLetter+"/"+SecondLetter+FirstLetter+".html";
parent.list.location=OpenMe;
}

"list" is the frame I'm trying to open it in. The page has two sets of
radio buttons, in arrays, to choose from. The file name is based on the
radio buttons they choose. "artist" is one array of radio buttons, "letter"
is the other array of radio buttons. If anyone can help me with this, it
will be greatly appreciated.
Jul 20 '05 #1
1 1702
On Wed, 11 Feb 2004 23:22:19 -0600, Jonathan Rubke
<ha*********@hotmail.com> wrote:
I am getting a filename from one frame and opening it in another frame.
It works fine if the file exists, but I'm trying to get it to show an
error message, possibly an alert box, if the file doesn't exist. Right
now, if it doesn't exist it just gives a error "page not found" in the
frame I'm trying to open it in.


[snip]

You can't use JavaScript to detect missing files. You would need to read
the HTTP Status-Line and check for 404, and JavaScript is unable to do
this.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2

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

Similar topics

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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.