/    Sign up×
Community /Pin to ProfileBookmark

Need a function written

The issue I have is my home page pulls a calendar page through an I Frame. I have the I Frame calling an asp page (say.. june.asp) . I have a page per month built out to december 2006. The hassle with this is that as soon as July comes I have to manually go into my home page and change june.asp to july.asp or it will just stay at june everytime someone opens my homepage. I’m sure there’s a way to make the I Frame call a variable and create javascript to do a getdate where, IF getdate is = “thisdate” THEN variable = “thispage” ELSE IF getdate is = “nextdate” THEN variable = “nextpage” and write one for every month. Sounds pretty simple but I can’t figure it out. Can anyone help out? ?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 02.2006 — It would be best if you did this all on the server side. Such a server-side home page would be [b]default.asp[/b] rather than [b]index.html[/b] -- but... For a JavaScript solution:

Put this in the HEAD:

<script type="text/javascript">

var months = ["January", "February", "March", "April", "May", "June", "July", "August", "October", "November", "December"];

</script>

Then, code your IFRAME as follows:

<iframe name="calendar" src="about:blank" ...etc...>Calendar</iframe>

<script type="text/javascript">

self.frames["calendar"].location.href = months[(new Date()).getMonth()].toLowerCase() + ".asp";

</script>
Copy linkTweet thisAlerts:
@dthurman1432authorJun 02.2006 — My home page is in asp but I thought it would be easiest with a function. Do you know of an asp way?
Copy linkTweet thisAlerts:
@phpnoviceJun 02.2006 — In ASP, the following is all that is required:

<iframe src="<%=LCase(MonthName(Date(), False))&".asp"%>" ...etc...>Calendar</iframe>
×

Success!

Help @dthurman1432 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.5,
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,
)...