...

View Full Version : Import / including HTML



SydeffeX
12-09-2004, 02:21 AM
Hi, i'm new to the forums, i look forward to a long stay.

Is there a way i can import a chunk of html onto a page from an external file? i've used cfinclude in the past but now i'm on a server that doesnt use coldfusion.
i suppose i could setup a css template, but i was hoping i could just replace one line with java instead of going through the trouble of creating a template for an already-created website.

hemebond
12-09-2004, 02:32 AM
Server-Side Includes.

SydeffeX
12-09-2004, 04:57 AM
anything else?

hemebond
12-09-2004, 06:21 AM
Almost any server-side scripting language.

SydeffeX
12-09-2004, 01:27 PM
yeah... of course...

i feel like i'm asking for the recipe for pudding and i'm getting "there's milk in it."

i know server side scripting will do it, i've done it before with coldfusion... would you happen to know the syntax to do it another way?

jbot
12-09-2004, 02:23 PM
would you happen to know the syntax to do it another way?

you could always try using an iframe or use the object tag:


<object data="whatever.html" type="text/html">better done serverside</object>

Willy Duitt
12-09-2004, 04:49 PM
yeah... of course...

i feel like i'm asking for the recipe for pudding and i'm getting "there's milk in it."

i know server side scripting will do it, i've done it before with coldfusion... would you happen to know the syntax to do it another way?

No, you are not being told "there's milk in it"...
What you are being told is there are many kinds of pudding, look in the cookbook under "cakes & puddings" and pick which one you want....

There are many serverside methods... Some servers support serverside includes, most support PHP... The syntax is a little different for either... So pick one that your server supports and then you can easily find what syntax to use...

It's all in the "cookbook"....

.....Willy

brothercake
12-11-2004, 01:35 AM
Download the Import HTML script that goes with my menu - http://www.udm4.com/menu/modules/import/ for info and http://www.udm4.com/udm-resources/udm-x-import.zip for the download - that script contains the core code for reading HTML out of an <object> or <iframe>

Remember that it must be a complete HTML document you're reading - you can't use a text file and expect it to have a DOM. Also, Safari and Mac/IE5 can't read the contentDocument of an <object> so for full cross-browser support you should use an <iframe>, although that will of course restrict you to an XHTML Transitional doctype (unless you're using Modular XHTML)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum