Detecting server errors in iframes

This is a discussion on "Detecting server errors in iframes" within the JavaScript Forum section. This forum, and the thread "Detecting server errors in iframes are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 13th, 2007, 15:14
New Member
Join Date: Dec 2007
Location: London
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Detecting server errors in iframes

Hey,

I'm using the Overture keyword search site quite often. I constantly get timeout errors, which frustrates me .
Therefore I tried putting their site into an iframe on my local machine. I've created a form which posts to the iframe and I was hoping that when the iframe would receive a 408 error the document would simply repost the form.
I can't get it to work and wondered if any of you experts out there can tell me if this is at all possible and if so where I'm going wrong.

Here's my code:

HTML: Select all
<h1>Keyword Search Tool</h1>
    <form action="http://inventory.overture.com/d/searchinventory/suggestion/" target="overture" method="post" id="query_form">
        <input type="hidden" name="mkt" id="mkt" value="us">
        <input type="hidden" name="lang" id="lang" value="en_US">
        <input type="text" name="term" id="term" size="20">
        <input type="submit" value="Query" />
    </form>
    
    <iframe src="http://inventory.overture.com/d/searchinventory/suggestion/"
            width="100%"
            height="500px"
            frameborder="0"
            name="overture"
            id="overture">
    </iframe>
    
    <script type="text/javascript">
        document.getElementById( "overture" ).onServerError = serverErrorCatch;
        function serverErrorCatch(e) {
            switch (e.status) {
                case '408':
                document.getElementById( "query_form" ).submit();
                break;
            }
        }
    </script>
Reply With Quote

  #2 (permalink)  
Old Dec 14th, 2007, 01:43
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Detecting server errors in iframes

You aren't able to access the the page when the iframe is pointing at an external source (outside the parent page's scope).

You will probably find that you are receiving a permission denied error when you attempt to read the server error in the iframe.

Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting characters between < and > ? Kerosene JavaScript Forum 5 Jan 16th, 2008 16:32
Detecting form navigation amits JavaScript Forum 4 Aug 24th, 2007 16:26
Two errors - Similar Errors too. PicoDeath Web Page Design 6 Jul 27th, 2007 18:06
Detecting JRE version using javascript Nagendra JavaScript Forum 0 Sep 18th, 2006 05:08
Detecting Flash skuff Flash & Multimedia Forum 2 Aug 19th, 2003 08:38


All times are GMT. The time now is 04:42.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43