homepage Welcome to WebmasterWorld Guest from 184.73.87.85
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
insert HTML code from file into HTML page
donelson




msg:3767441
 10:44 pm on Oct 16, 2008 (gmt 0)

I have around 100 web pages on a site. Most of these pages are the same, except for some HTML.

I'd like to #include the complex, bulk HTML from a file into each page, so that I can easily change the bulk HTML in one place and have it "appear" when the other pages get loaded into a browser.

The bulk HTML has seven <div's> in it, some with tables and text and images, etc.

I cannot use PHP or server-side scripting to php-include etc, because this has to run offline.

I tried using:

<object type="text/html" data="myFile.htm"></object>

but it doesn't place the clean HTML cleanly into the page -- it appears in some kind of scrolling div or something.

I also tried using the DOM to create a text node, but couldn't get the div's in the bulk file to actually appear in the page.

Any ideas?

Thanks

 

daveVk




msg:3767558
 2:35 am on Oct 17, 2008 (gmt 0)

Run PHP offline in batch mode to produce static pages maybe ?

donelson




msg:3767663
 7:47 am on Oct 17, 2008 (gmt 0)

I did have the <object> solution working yesterday, but I must have changed something, somewhere, because it doesn't work anymore (not that it's very complex).

What I see now when I look at the page source in the browser is:

blah
<object data="foo.htm">
blah

whereas before, when it worked, I saw the expaned foo.htm inline in the page code.

Go figure.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved