473,656 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catch a 404 when using an iFrame

I am using iFrames to integrate two systems at the HTML level.
If the included content in an iFrame is not available, how can I detect
this in the outer page in JavaScript?

Thanks, plex4r

Oct 6 '05 #1
1 18994


plex4r wrote:
I am using iFrames to integrate two systems at the HTML level.
If the included content in an iFrame is not available, how can I detect
this in the outer page in JavaScript?


The frame will display the answer from the server and there are no
objects or properties on window or document to find out the HTTP
response status that resulted in the document sent.

If you know what kind of 404 error document that server sends you could
check the title perhaps e.g.
var frameDoc = window.frames.i frameName.docum ent;
if (frameDoc.title == 'title the server sends for 404') {

Besides that you could make a HTTP HEAD request for the frame URL with
XMLHttpRequest in browsers that support that. There you can check the
HTTP response status code.

Both approaches work only if the container document and the frame
document are served from the same server.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 6 '05 #2

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

Similar topics

3
2244
by: Tony Johansson | last post by:
Hello! When you allocate object dynamically which mean on the heap I find that a problem when using exception. What is the prefer method to handle this kind of problem. //Tony
5
22090
by: Dominic | last post by:
Hi everybody, My goal is to set the height of the iframe to fit its content. There was an earlier posting which gave some useful insights. http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=d2d855ea.0307060828.2965dfda%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26q%3DCalculating%2BIFrame%2Bsize The key idea is function getInnerHeight(iframe){
1
2561
by: Eli | last post by:
Hi, I've created a dynamic IFRAME and inserted it in the document. Then I changed the src property to some URL (not the same domain as the main document). I want to check when the IFRAME is loaded and then get its title to put in the main document. function GetTitle() { var
4
1384
by: David Douglass | last post by:
I'm confused about the program below. Based on my reading of the C# spec, I don't think it should compile, but it does when using Beta 1. Could somebody please explain the function selection rules to me? Thanks, -- David Douglass MCSD for Microsoft .NET =================================================== #region Using directives
2
3489
by: Ash | last post by:
Hi, I'm working on an application that takes csv files then converts it to XML. It then write the XML to a msmq where another service is reading the queue and sends it to the DB. My question is: My application flies (when using the Message object to wrap my data in a non-transactional Q. When using MessageQueueTransaction in a transactional Q the memory usage (in task manager) keeps getting larger (as if GC never cleans up)
1
5687
by: Cerebrus | last post by:
Hi all, Using : .NET 1.1, SQL Server 2000, Win 2K. Could anyone confirm if there is a bug in the SqlDataReader.GetChars() method when using CommandBehavior.SequentialAccess to get a BLOB string from the database ? I have searched all over, and found many threads with the same problem as I, but no word from the MS folks that this is a bug. This problem only seems to occur when using GetChars, not with GetBytes. But since it is a ntext...
3
4347
by: Sirix42 | last post by:
Hi there, when I use Firefox to run my application (this involves sending an IFRAME request to the servlet and handling the response), there is no delay in displaying the data after each response. But when I use IE, there seems to be a 1-2 second delay. The script sends a request using IFrame, goes through a loop to return script tags containing data to the browser, and then data is displayed by the browser and a new request is sent. For...
6
5141
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick application working. However, when attempting to implement the solution, the AJAX calls weren't updating the screen like the examples were and seemed not to fire until after the long running process had completed. I found the only real...
2
2419
Patropia
by: Patropia | last post by:
Hi, I have an iframe that's using designMode in which I'm loading some code. When including an iframe in that code (putting an iframe in the iframe) the entire frame goes blank. This only happens when using firefox, with IE it just shows the iframe. Does anyone know how to solve this, Thank you very much, Greetz,
3
1167
by: durga u | last post by:
How to maintain the state of the page in autorefresh ? I am displaying different alerts in different grids.The default value of the sections is collapse.But i click on the sections it will be expanded .But when the page is auto refreshed it should be previous state expanded of the particular section.But it is not like that .As i am using iframe control it is not working .Can anyone suggest me what i can do?
0
8382
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8498
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.