Jump to content

How do i : Embed a .html into another .html page


bbr

Recommended Posts

Ok, here's my issue.I'd like to embed a html into another html.In detail, i have 3 pages, and 1 page with the "navigation bar".I'd like to embed the navigation bar page into each of the other pages so that i don't have to copy paste the navigation bar into each of the other pages anytime i make a change to it.Now, frames would obviously be an option, but i think that's a bit outdated and ugly.the <object> tag seems to have the option to do what i need,, but i'm not sure if its fully compatible with all browsers i use (firefox, safari, ie7).Perhaps there's a more widely accepted option to do this with?Hopefully someone can give me an insight in this.

Link to comment
Share on other sites

A server side language such as php or asp can do that for you.Have a look at the w3schools tutorials about that topic.Your Hosting service *may* have the php or asp software for you to use, but *some* Hosts do not allow it. Check with your Service provider.

Link to comment
Share on other sites

A server side language such as php or asp can do that for you.Have a look at the w3schools tutorials about that topic.Your Hosting service *may* have the php or asp software for you to use, but *some* Hosts do not allow it. Check with your Service provider.
Cheers for the quick reply, i'll give a poke to one of the admins.Hopefully it's possible.
Link to comment
Share on other sites

One method to check to see if you are able to run php is to cut and paste the following code into a file named test_for_php.php, upload it to your Host and then use you browser to navigate to the page on your Hosting account. (http://www.yourdomain.com/test_for_php.php) Change the yourdomain value. of course.It replies with an error if you are not able to use php and gives you a whole bunch of info about the php configuration if it is enabled on your account.

<?php$inis = ini_get_all();echo '<pre><br />';print_r($inis);echo '</pre><br />';?>

Or a simple phpinfo() would work, too.

<?phpphpinfo();?>

Same thing, upload it as a php file and navigate to it using your browser.

Link to comment
Share on other sites

One method to check to see if you are able to run php is to cut and paste the following code into a file named test_for_php.php, upload it to your Host and then use you browser to navigate to the page on your Hosting account. (http://www.yourdomain.com/test_for_php.php) Change the yourdomain value. of course.
Shame, but seems i can't upload php files to begin with.
The file extension: php is not supported
I guess i'll have to settle for a pure html solution for now, unless i can bribe an admin :)
Link to comment
Share on other sites

Can you use XML and XSLT files? If so, you could use XML to store per-page data and transform each one with a single XSLT file containing the common data. Read on the XML and XSLT tutorials and test if this is allowed on the server.

Link to comment
Share on other sites

Can you use XML and XSLT files? If so, you could use XML to store per-page data and transform each one with a single XSLT file containing the common data. Read on the XML and XSLT tutorials and test if this is allowed on the server.
Seems i'm restricted to: css, html, gif, png, jpgSo no xml either.I've mailed 2 of the admins, hopefully some more file formats will be allowed for upload soon.
Link to comment
Share on other sites

The complete list of types i can upload is :"Allowed Types: gif, jpg, jpeg, png, swf, html, css, txt"So, even .js is currently unavailable unless i put it directly into the .html file.Ah well.This "seems" to work for now, not happy with it though. (its very slow, and doesn't seem to work properly in IE)Some tweaking required still.Edit: added div to center it in IE as well. Seems ok now.

<div id="nav" align="center"><object type="text/html" data="linktest.html" width="600" height="40" align="center"><param name="BorderStyle" value="1" /><param name="MousePointer" value="0" /><param name="Enabled" value="1" /></object></div>

If you wish to replicate this, make sure you put target="_parent" in any hrefs in the linked page object.Edit2: doesn't work on windows.... ugh.Edit3: ok blast.. i don't see any way to get it working.on mac-safari it works perfectly.on mac-ie5,6,7 whatever it works fine.didnt try mac firefox, but i suspect itll work.at home, on windows xp with ie7, all i see is a blank box.i'm clueless...

Link to comment
Share on other sites

IE does not recognise the <object> tag, instead having the more limiting variation <embed> (which can't embed other HTML files, unfortunately, I don't think)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...