/    Sign up×
Community /Pin to ProfileBookmark

Loading webpage into a table

Hello and thank you to all for getting me this far. I have searched the past articles on this site to create my script so far but have reached an empass(sp?). My problem is very simple I am working on a menu selector. The code generates a seven day calendar that is put in the first row of a 1 column 2 row webpage. When you click on a day in the calendar it will select a menu webpage and place it in row 2.

Everything is working except for the following code.

function createlink (summer) {
var menuweek = 0;
var corday=”mon”;
var Day=new Array();
Day[0]=”sun”;
Day[1]=”mon”;
Day[2]=”tue”;
Day[3]=”wed”;
Day[4]=”thu”;
Day[5]=”fri”;
Day[6]=”sat”;
if (day+offset<7)//day is a variable loaded from elsewhere
{
corday=Day[day+offset];
}
else
{
corday=Day[day+offset-7];
}
return (“http://www.gettysburg.edu/administration/dining/cgi-bin/menu/menus/”+corday+summer+”.html“);

document.URL= createlink(5);

My problem is that the last line calls the webpage and takes over the entire browser instead of placing it in the second row of the current browser. Is there a location tag or something that I can force it to go where I want in a given table on the current page?

PS I wanted to include the rest of the code but it is too big.

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@violent_jMay 19.2004 — you'll have to use DOM methods to accomplish this

first, set an ID in the TD tag of the second row

then, use document.getElementById('yourID') to get a pointer to the element, and set the innerHTML property to whatever you want

grtz
Copy linkTweet thisAlerts:
@JdgreenauthorMay 19.2004 — I am sure that I implemented it incorrectly. It has gone from opening the webpage into the entire page to doing nothing. Just so it's clear I have no experience with javascript. Thats why I may seem a bit dense on some of these subjects.

<html>

<head>

</head>

<body bgcolor="#FFFFFF">

<script language="JavaScript">

//where createlink() function creates a link to a webpage

document.getElementById('menu').url= createlink(5);

</script>

</td>

</tr>

<tr>

<td height="552" id="menu">&nbsp;</td>

</tr>

</table>

</body>

</html>

Thanks,
×

Success!

Help @Jdgreen 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 5.4,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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