Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Location
    Chicago
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Import / including HTML

    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.

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Server-Side Includes.

  • #3
    New to the CF scene
    Join Date
    Dec 2004
    Location
    Chicago
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anything else?

  • #4
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Almost any server-side scripting language.

  • #5
    New to the CF scene
    Join Date
    Dec 2004
    Location
    Chicago
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #6
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SydeffeX
    would you happen to know the syntax to do it another way?
    you could always try using an iframe or use the object tag:

    PHP Code:
    <object data="whatever.html" type="text/html">better done serverside</object
    *keep it simple (TM)

  • #7
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SydeffeX
    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

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •