By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

monthly frames

P: n/a
I am using frames - yes frames - I do not know how to do anything but and I
know that there is better out there......but........
I am trying to set a frame so that it automatically puts a page
corresponding to the month in that frame (a calendar)

I know this is way off (sleep should have happened hours ago)

can anyone help????

Thank you

script language="JavaScript"><!-- function tresmonth() {
var mydate=new Date()
var month=mydate.getMonth()
var display=new Array("jan.html",
"feb.html",
"march.html",
"april.html",
"may.html",
"june.html",
"july.html",
"aug.html",
"sept.html"
"oct.html",
"nov.html",
"dec.html")

<frame name="right" src="displayarray[month]>}

// --</script>
Sep 19 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
prophet wrote on 19 sep 2006 in comp.lang.javascript:
I am using frames - yes frames - I do not know how to do anything but
and I know that there is better out there......but........
I am trying to set a frame so that it automatically puts a page
corresponding to the month in that frame (a calendar)

I know this is way off (sleep should have happened hours ago)

can anyone help????

Thank you

script language="JavaScript"><!-- function tresmonth() {
var mydate=new Date()
var month=mydate.getMonth()
var display=new Array("jan.html",
"feb.html",
"march.html",
"april.html",
"may.html",
"june.html",
"july.html",
"aug.html",
"sept.html"
"oct.html",
"nov.html",
"dec.html")

<frame name="right" src="displayarray[month]>}

// --</script>
No need for any varable declarations ;-)
<frame name='right' src='' id='right'>

<script type='text/javascript'>
document.getElementById('right').src =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'
</script>

NOT TESTED

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 19 '06 #2

P: n/a
JRS: In article <YULPg.551874$Mn5.422149@pd7tw3no>, dated Tue, 19 Sep
2006 06:14:16 remote, seen in news:comp.lang.javascript, prophet
<M_*****@hotmail.composted :
>I am using frames - yes frames - I do not know how to do anything but and I
know that there is better out there......but........
Then read the newsgroup FAQ, and find them in js-date6.htm.
>I am trying to set a frame so that it automatically puts a page
corresponding to the month in that frame (a calendar)
By your way, you will need up to 91 different files; 12 month names (one
with two lengths) times 7 start-days.

Far better to get a year and month, or a Date Object, and compute
everything.

It's a good idea to read the newsgroup and its FAQ.
--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Sep 19 '06 #3

P: n/a

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn*******************@194.109.133.242...
prophet wrote on 19 sep 2006 in comp.lang.javascript:
>I am using frames - yes frames - I do not know how to do anything but
and I know that there is better out there......but........
I am trying to set a frame so that it automatically puts a page
corresponding to the month in that frame (a calendar)

I know this is way off (sleep should have happened hours ago)

can anyone help????

Thank you

script language="JavaScript"><!-- function tresmonth() {
var mydate=new Date()
var month=mydate.getMonth()
var display=new Array("jan.html",
"feb.html",
"march.html",
"april.html",
"may.html",
"june.html",
"july.html",
"aug.html",
"sept.html"
"oct.html",
"nov.html",
"dec.html")

<frame name="right" src="displayarray[month]>}

// --</script>

No need for any varable declarations ;-)
<frame name='right' src='' id='right'>

<script type='text/javascript'>
document.getElementById('right').src =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'
</script>

NOT TESTED

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Thank you, but did not work.

Sep 20 '06 #4

P: n/a
prophet wrote on 20 sep 2006 in comp.lang.javascript:
><script type='text/javascript'>
document.getElementById('right').src =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'
</script>

NOT TESTED
>
Thank you, but did not work.
You off all people should know a prophed on his home turf ...

How do you program?
Just using an example as-is?
Or examening, debugging and using the method?

What do you men by "not work"?

did you try:

<script type='text/javascript'>
var s =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'

alert(s)

// document.getElementById('right').src = s
// the above line only works if the id is already defined.

</script>

to narrow down the problem?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 20 '06 #5

P: n/a

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
prophet wrote on 20 sep 2006 in comp.lang.javascript:
>><script type='text/javascript'>
document.getElementById('right').src =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'
</script>

NOT TESTED
>>
Thank you, but did not work.

You off all people should know a prophed on his home turf ...

How do you program?
Just using an example as-is?
Or examening, debugging and using the method?

What do you men by "not work"?

did you try:

<script type='text/javascript'>
var s =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'

alert(s)

// document.getElementById('right').src = s
// the above line only works if the id is already defined.

</script>

to narrow down the problem?

I am new to this so I try it as written and then play with it to figure it
out. Sometimes I get it right away - sometimes it takes a bit of work to
figure it out.

The code comes up with an empty frame.
Sep 21 '06 #6

P: n/a
prophet wrote on 21 sep 2006 in comp.lang.javascript:
>did you try:

<script type='text/javascript'>
var s =
'jan/feb/march/april/may/june/july/aug/sept/oct/nov/dec/'.
split('/')[new Date().getMonth()]+'.html'

alert(s)

// document.getElementById('right').src = s
// the above line only works if the id is already defined.
Or perhaps it does not.
>>
</script>

to narrow down the problem?


I am new to this so I try it as written and then play with it to
figure it out. Sometimes I get it right away - sometimes it takes a
bit of work to figure it out.

The code comes up with an empty frame.
Did you ask yourself why?

It seems, as you do not try to undersand coe and to learn, but only want
ready made solutions, you better hire a payed programmer.

I will give you another code, try it out as test.html:

=================
<script type='text/javascript'>
setTimeout(
'window.frames["b"].location = "http://cnn.com"',
800)
</script>

<frameset cols="50,50">
<frame src="" name='t'>
<frame src="" name='b'>
</frameset>
=================
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 21 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.