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

Help with Minute javascript issue please.

P: 13
Hi, heres it is, I'm trying to rotate these content items by minute. Can anyone see what I am doing wrong? Thanks, Tami

var content = new Array();

content[1] = "page.html";
content[2] = "anotherpage.html";

var mydate = new Date();
var myminutes = mydate.getMinutes();
{
var minutes = '1' + minutes;
}

var iframeprops = 'width=150 height=100 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"';

function minute_iframe() {
document.write('<iframe id="dynstuff" src="',content[myminutes],'" '+iframeprops+'></iframe>');
}
Sep 13 '06 #1
Share this Question
Share on Google+
6 Replies


P: 13
I messed up I am pretty sure these two:

var mydate = new Date();
var myminutes = mydate.getMinutes();

Should be replaced with something like this, but still not working.
var myminutes = today.getMinutes();
Sep 13 '06 #2

P: 13
I'm being told in a javascript error message that "today" is undefined.
Sep 13 '06 #3

P: 13
Ahhhh I got it! Had to change several things around.
Sep 13 '06 #4

P: 13
Hi I have a working copy of some script that works.

var mydate = new Date();
var mytoday = mydate.getDate();

How do I change this to get minutes intead? Maybe seconds would work too if
I can adjust the seconds to equal minutes.
This is what I have but its not working. Hope someone can help, thanks! Tami

var today = new Date();
var minutes = today.getMinutes();
{
var minutes = '1' + minutes;
}
Sep 14 '06 #5

P: 13
This is what I have now and it almost works.

var today = new Date();
var minutes = today.getMinutes();
setInterval("minute_iframe()", 60000);

It changes the object on its own in one minute but then it stops, it won't keep
changing it automatically.
Sep 14 '06 #6

P: 13
Nevermind, got it.
Sep 14 '06 #7

Post your reply

Sign in to post your reply or Sign up for a free account.