/    Sign up×
Community /Pin to ProfileBookmark

Including external html code into page

Is there any way to include some html code from another file into my current page, without using server-side programming? What I would like to do is to insert at a particular section of the page html code from another page.

I considered using <iframe>, but I don’t seem to be able to ‘stretch’ the height of the frame to fit the size of the outside page (ie, I always get a certain height and then scroll-bars if the outside page exceeds the height).

Any thoughts would be greatly appreciated.

thanks.

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@zingmatterMar 21.2006 — You could try using AJAX to call the appropriate content from a server file and place it into a div element using .innerHTML in javascript.
Copy linkTweet thisAlerts:
@TheBearMayMar 21.2006 — Is the page on the same server? If so does the server support SSI?
Copy linkTweet thisAlerts:
@felgallMar 21.2006 — Both AJAX and SSI use server side processing. The only way to do it without anything on the server is iframes.
Copy linkTweet thisAlerts:
@BytesMar 22.2006 — Place this code in a JavaScript menu, entitled:

[CODE]<script language="JavaScript" src="openingSlidingWindow-nagvigation.js"></script>[/CODE]Place this within the menu:
[CODE]<!-- Begin

// NOTE: If you use a ' add a slash before it like this '

function expandingWindow(website) {
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 7; // horizontal scrolling speed (higher = slower)
var leftdist = 0; // distance to left edge of window
var topdist = 0; // distance to top edge of window
if (document.all) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=yes");
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
sizer.resizeTo("1", sizeheight);
}
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
sizer.resizeTo(sizewidth, sizeheight);
}
sizer.location = website;
}
else
window.location = website;
}

// End -->[/CODE]
Place this within the <BODY> of your document:
[CODE]<a href="http://javascript.internet.com/" onClick="expandingWindow('http://javascript.internet.com/');return false;">Open JavaScriptSource.com!</a>[/CODE]Hope this helps,
×

Success!

Help @Vic 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.16,
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,
)...