Wife/Girlfriend/Sister?
Pepper Spray &
Stun Gun Specials!
KEEP THEM SAFE.
 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
46 active users
1299 visitors today
1944 pages today
how is this done?
Tools I use

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

ASP.NET Blog
RSS submissions
E-commerce

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

Tiki Statues - Tiki Masks - Tiki Totems



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...


See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!