Click to See Complete Forum and Search --> : Prevent "Auto HTML" Of Text In An I-Frame?


lightnb
12-01-2008, 09:38 PM
When I load a text file with the proper "text/plain" mime header into an I frame, FF3 (I haven't tried other browsers yet) insists on adding HTML, Head, and Body tags around it.

So the file:

This is some text

becomes:

<html><head></head><body>this is some text</body></html>

Which is rather annoying. If you load a text file directly, it doesn't do this, just when the text file is loaded in an i frame. Is there a way to prevent this? Or is an I-Frame only allowed to hold a full and "proper" HTML document?

techwebonline
12-02-2008, 01:26 AM
Hi,

Are you using a specific program or are you coding in notepad? :confused: Seems like you may be using some sort of software that has a funky setting in it.

You may want to consider using PHP so you can embed what you want into your page instead of using an iframe. I'm not seeing iframes being used very much anymore.

:)

felgall
12-02-2008, 02:57 AM
iframes are deprecated and supposed to be replaced with the object tag but IE still has a few issues regarding borders on objects.

\\.\
12-02-2008, 04:36 AM
And I thought I had problems....

Well I use FF3 and I don't get any of the issues that you are getting.

I would say that you should check your plug-ins as one of them may be the culprit.

lightnb
12-02-2008, 02:19 PM
Hi eveyone,

Thanks for your replies. In order of response:

techwebonline:

I'm writing all code from scratch in an IDE that just does syntax highlighting. It doesn't do anything but change the color of the words I type, for display purposes. The site is written in PHP, I'm just using the I-frame for AJAX(ish) file upload, since XMLHttpRequest doesn't seem to support binary data at this time. The contents of the I-Frame (on upload) should be a response text string from the server with a success or failure message.

I'm sending the message with the text mime type, but the browser insists on adding the extraneous tags.

felgall:

Can you submit forms through the <object> tag?

\\.\:

I'm using FireBug and the web developer tool bar.

Thanks for your help!