monthly frames

P

prophet

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>
 
E

Evertjan.

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
 
D

Dr John Stockton

JRS: In article <YULPg.551874$Mn5.422149@pd7tw3no>, dated Tue, 19 Sep
2006 06:14:16 remote, seen in prophet
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.
 
P

prophet

Evertjan. said:
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

Thank you, but did not work.
 
E

Evertjan.

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?
 
P

prophet

Evertjan. said:
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.
 
E

Evertjan.

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.
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>
=================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top