I am trying to embed my cgi:irc script into my html page, it works fine if i simply point a hyperlink to it, but it looks horrible and comes up in a different page, so i tried the <embed> tag like this :-

<embed src="https://alienlinux.homelinux.net/cgi-bin/cgiirc-0.5.9/irc.cgi" align="center" width="520" height="360"></embed>

but it says unknown file type text/html
so i guess i need a type= adding to it but i don't know what to put, can anyone help, tell me what type or put me back on the right path to making this work?
thanks :)

Recommended Answers

All 5 Replies

enbed is deprecated and does not work in all browsers. Use object.

I don't suppose anyone knows a good reference for this? the w3schools reference is basic at best and they have no examples. It seems that object also needs a codetype: mimetype; and there is no listings of these. all i have found on google are references to java and flash. so far i have had no luck whatsoever to get anything displayed at all using <object>

thanks for the minimalistic answer that so far caused me no end of grief but how do i use object in this case please? :(

you don't need all of the fields; try this:

<object type="text/html" width="300" height="300" data="http://url/file.html"></object>


works ok for me in opera 9 and firefox 2.. doesn't seem to work atall in IE6 though.

hm.. i wonder, how one would address parts of the inner document using this method? i'm suprised the W3 keep changing their mind about this really, a while back, iframes were supposed to be 'the way forward'.

to be honest, I prefer SSI (server side includes of any breed, not just SHTML) to stick things 'into' pages.. admitadly it forces cache-reduction/elimination, and causes marginally longer fetch times; but at least i don't have to worry about unsupported browsers and deprecated tags, to so much of a degree anyway.

That did it :D TY!!!!!!!!
omg i can't believe i couldn't find this anywhere put so simply as you did TY TY TY!!!!!
I now have cgi:irc plugged into my homepage and it looks neat! better than popping up in a new window and being on a boring white background. you've given me new hope and vigour to code on!
Thank You so much mate ! :D

lolz.. i think perhaps it was only that i was searching google from a different perspective; since i've personally never used object tags for anything but java/flash/etc in html pages, where you do occasionally need to provide more information in the tag definition.

anyway, the page where i found that code was on the first result for a google search of:

object html inside html

any search like 'object embed html' or 'embed html with object' gives pages that compare the embed tag and object tag, of which there are many.

google respects order of terms, to a higher degree than people sometimes think... i find, the most fruitful complex search queries start with the most important word, then continue with some kind of question, without the words 'how do i', and, in this case, without any words that might pollute the results with uneccessary information. (i.e. embed)

just a tip ^_-

hmm, i suppose you'd need to know that (for the most part) cgi scripts reply in the type "text/html" to know that that was what you needed to search for in the first place; but yes, regardless of the way a page is prepared at server, the request for [data] in object tag expects a reply of type [type] not a file on the server of type [type]; any time you see HTML in the browser window after requesting a cgi-script's data, the script sent data of the type 'text/html' (or 'application/xml+xhtml' =P) so:

<object type="text/html" data="http://whatever.tld/myscript.cgi"/>

Object (checks to see if it can handle the [type] of [data])*, then requests http://whatever.tld/myscript.cgi; myscript.cgi replies with a response typed as [type], and object shows that data using the handler for [type]. It doesn't really matter how the server made that response, as long as it did, and as long as it's the correct type, and is headered as such.

* i assume it does this first, it wouldn't make sense to request data knowing it's unhandlalbe - if i wrote the browser, i would certainly do this check first.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.