/    Sign up×
Community /Pin to ProfileBookmark

using object tag to embed external html

I made a simple static menu using plain html. I have embedded this menu.htm into my main file (index.htm) by using the <object> tag.
I successfully load the index.htm file and see the menu.htm file embedded nicely inside.

But when you click an <a href> link in the menu, the resulting content is trapped in the predefined area of the screen allotted for the <object>.

I would like the content to overtake the screen.

The only workaround seems to be to have the content open in a new window. But I don’t want each menu item to have to open in a new window.

text/html based embedded objects seem to function like frames, but there doesn’t seem to be any associated code similar to parent/child frame manipulation.

Am I missing something?

Thanks!

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@PhillMcSep 17.2004 — Hmm.

If you have Server Side Includes available to you then try this:

<!-- #Include virtual="somepage.htm" -->

This is the method that I use to 'embed' external source.

If you do not have this ability, perhaps the 'target' attribute of the 'a' element would help you. Check out the HTML Tutorials link in my signature. You should find some answers there. ?
Copy linkTweet thisAlerts:
@skauliusauthorSep 17.2004 — Thanks ?

So it sounds like maybe the object tag is not the best thing to use for linking an external static menu.

What would you recommend as the simplest method to link a purely html based static menu? Should I somehow use javascript to call it? I know Dreamweaver has you use library items, but I don't want to be stuck with vendor software.

Thanks!
Copy linkTweet thisAlerts:
@PhillMcSep 17.2004 — If server-side includes are available to you, then the method I gave earlier is the easiest.

If you do not, maybe you could try setting the height and width of the 'object' element using CSS or presentational markup in the element declaration itself.

Let me know how it turns out. ?
Copy linkTweet thisAlerts:
@skauliusauthorSep 17.2004 — Thanks,

I don't have access to "server-side includes" so I decided to use javascript. It's a bit time consuming, but it works. Here's the solution I came up with...

In the index.htm header I put...
---------------------------


<script src="mymenu.js">

</script>
---------------------------



"mymenu.js" is just a text file which contains...
---------------------------


function WriteMenu(){

mystring="<table>"+

"<tr><td>"+

"<a href='www.url.com'>link</a>"+

"</td></tr>"+

"</table>"

document.write(mystring)

}
---------------------------


That's the time consuming part - after copy/pasting the html code into the text file, it takes a while to put in all of the quotes.

Later in the index.htm file I put...
---------------------------


<script>

WriteMenu();

</script>
---------------------------



And that's it! ?
Copy linkTweet thisAlerts:
@PhillMcSep 17.2004 — Yea, it works, but...

What if I don't have javascript or it's disabled? Then I can't use your site. Javascript isn't a bad thing, one just shouldn't use it for site critical items.

Did you try setting the height and width of the object element?
Copy linkTweet thisAlerts:
@skauliusauthorSep 17.2004 — I'm not sure what the code would look like to sense an onClick event for the object. If index.htm contains the object code, how does it sense that the object (menu.htm) has been clicked? Then would you need some sort of function to be executed after the onClick event in order to execute the resizing to fullscreen? Furthermore, would this not create objects opening within objects, thus hurting performance?

Thanks ?
Copy linkTweet thisAlerts:
@PhillMcSep 17.2004 — No, you do not need special code to get a hyperlink in work in embedded HTML.

Again; try setting the height and width of the object element...
×

Success!

Help @skaulius spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...