/    Sign up×
Community /Pin to ProfileBookmark

variable src= in HTML

I have a webpage that picks up a monthly calendar. I want it to pick up the current month’s calendar file. So March’s calendar is march.html, April’s calendar is april.html etc
.
I currently have to modify the webpage each month and change the default html value to the current month’s html.

I see the javascript getmonth() which gives me the month number, and I know how to convert that to a month name.

But what I don’t know how to do is something like this:

Change this:
<frame src= “http//www.losaltosrotary.org/february.html”

to something like this:

<frame src=”http//www.losaltosrotary.org/” +currentcalendar+”.html”

where currentcalendar has a value of march generated by some earlier javascript function.

Any thoughts?

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@AltF4Mar 07.2006 — Well take it to the Javascript Forum. Ask for an if statement.
Copy linkTweet thisAlerts:
@MattCabotauthorMar 08.2006 — so you are saying this can not be done in html, but must be done in javascript. That surprises me. Thanks.
Copy linkTweet thisAlerts:
@ray326Mar 08.2006 — Then I'd recommend the Castro book in my sig.
Copy linkTweet thisAlerts:
@KravvitzMar 08.2006 — [url=http://www.thecounter.com/stats/2006/February/javas.php]Keep in mind that some Internet users use a browser that doesn't have JavaScript enabled.[/url]

I'd recommend using a server-side language, like PHP, to do it.

[url=http://www.html-faq.com/htmlframes/?framesareevil]Whay are frames so evil?[/url]

[url=http://karlcore.com/articles/article.php?id=2]Why Frames Are Bad[/url]

http://apptools.com/rants/framesevil.php

http://www.456bereastreet.com/archive/200411/who_framed_the_web_frames_and_usability/

[url=http://www.useit.com/alertbox/9612.html]Why Frames Suck (Most of the Time)(1996)[/url]

[url=http://www.htmlhelp.com/design/frames/whatswrong.html]What's wrong with frames?[/url]

http://www.tamingthebeast.net/articles/framesnoframes.htm

[url=http://www.dorward.me.uk/www/frames/]Frames - The Problems And Solutions: Explanations as to why you probably shouldn't use frames, along with alternatives that you can use instead.[/url]
Copy linkTweet thisAlerts:
@ray326Mar 08.2006 — He was surprised that didn't work. He needs to start by learning HTML.
Copy linkTweet thisAlerts:
@felgallMar 08.2006 — A lot of people don't know the difference between a markup language such as HTML or XML and a programming language such as Javascript or PHP. They serve completely different purposes and while a programming language can create markup a markup language can't do programming.
Copy linkTweet thisAlerts:
@MattCabotauthorMar 08.2006 — OK. I got it. I just thought html was a bit more robust. I was a VB programmer, and I thought you cold put some variable in the link field, assign a value to it someplace else, and open a particular url.

I really didn't want to use javascript because of the controversery in using it.

Having looked at a couple of references provided by you guys I have concluded that "frames are bad" and I should know html better than I do. The last I definitely concur. I am still debating the first point.

All I want the code (html, javascript, or whatever) is to say, "open march.html file if the month is march, open april.html if it is april, etc. As I said, right now, monthly I go into the code (html) and change the month manually. I was just trying to streamline the process.
Copy linkTweet thisAlerts:
@KravvitzMar 08.2006 — I just thought html was a bit more robust.[/QUOTE]
It's not about robustness. HTML is used to markup text -- that is it provides structure and meaning to text. You need to use a programming or scripting language to do what you want to do.

I really didn't want to use javascript because of the controversery in using it.[/QUOTE]
Controversy?

Using JavaScript is perfectly fine, if you use it correctly.

[url=http://www.onlinetools.org/articles/unobtrusivejavascript/]Unobtrusive JavaScript[/url]

[url=http://www.thecounter.com/stats/2006/February/javas.php]Keep in mind that some Internet users use a browser that doesn't have JavaScript enabled.[/url]

Having looked at a couple of references provided by you guys I have concluded that "frames are bad" and I should know html better than I do. The last I definitely concur. I am still debating the first point.[/QUOTE]
Read the articles I linked to.
×

Success!

Help @MattCabot 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.6,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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