ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> IFRAME's...and IE 5.5 --> Part 2

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
157 active users
10220 visitors today
11058 pages today
how is this done?
ASP.NET Showcase
ASP.NET Graph and Chart Component with FREE developer version

ASP.NET Shopping Cart and E-commerce Control with FREE trial download

ASP.NET Web Hosting with free month and setup

$15 Domain Name Registration from .DNR.
As seen on these sites
Special thanks go to the sites that support me by publishing my articles.
See more

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
ASPRSS
ShawThing

Now open source with SourceForge!

IFRAME's to the rescue...ish
Looking for a way to tell the browser how big the results of a client-side JavaScript will be? You run it inside an <IFRAME>, which does have width/height attributes! So the code now looks like this:

<iframe
  src="http://ads.aspalliance.com/iframe.asp?m=6&t=1&target=_parent"
  width="468" height="60" marginwidth="0" marginheight="0"
  hspace="0" vspace="0" frameborder="0" scrolling="no">
  <script
    language="javascript"
   src="http://ads.aspalliance.com/displayad.asp?m=6&t=1&target=_parent">
  </script>
</iframe>

The new iframe.asp mentioned above simply outputs the <script> as before. It's repeated between the IFRAME tags for browsers that don't support them.

Finally, the problem with IE 5.5
Sorry for the long route to get here, but as soon as I changed my site to using IFRAME's I started getting emails from my HTTP 404 handler (it sends me an email whenever a user hits a "dead link" on my site).

It gets stranger! The files being requested were the <title> of the page containing the IFRAME, with "_files/iframe.htm" appended. So, this page, which has a title of "IFRAME's...and IE 5.5", would cause my server to get a request for a file called:

http://CoverYourASP.com/IFRAME%27s%2E%2E%2Eand+IE+5%2E5_files/iframe.htm

or, occasionally, this:

http://CoverYourASP.com/IFRAME%27s%2E%2E%2Eand+IE+5%2E5_archivos/iframe.htm

Isn't that bizarre? Study that for a moment and see if you can think of any reason for that - no-one I've asked can! Remember too, that when this happens the user-agent is always IE 5.5.

Ignoring the problem is easy. All I did was change my 404 handler (Handle404.asp) so that it didn't send me the email if the filename contained "iframe.htm" by adding the line below.

// don't send mail for IE's iframe bug
if ( -1 != sMissingFile.indexOf ( "iframe.htm" ) )
   return;

Featured sponsor
My favorite resources

Selling products online - read how James does it now



New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...