SitePoint Enthusiast
window open problem
Hi,
I've got a script which creates a interactive calendar. So that when you click a date that is "active" it opens up the appropriate page in another window.
The thing is I want it to load in the existing window as in "window.location" not in a new window as in "window.open"
But when I try to use window.location it says object doesn't support this action.
Anyone have any ideas?
Cheers
Andy
could you please post your code.
regards
Si
SitePoint Enthusiast
Hi Si,
code :-
function setDate(what,t){
if (t == 'M') {
cat = "monthly.php" }
else {
cat = "weekly.php" }
cd1 = new Date(what);
ad1 = new Date();
cdd = cd1.getDate();
cdm = cd1.getMonth();
cdy = cd1.getYear();
adh = ad1.getHours();
admm = ad1.getMinutes();
achk = (adh * 60) + admm;
add=ad1.getDate();
adm=ad1.getMonth();
ady=ad1.getYear();
adld = getNoOfDaysInMnth(adm,ady);
if(cdm == adm) {
if(cdd == add)
{
if (achk < 630) {
window.open(cat);
}
else {
alert("Sorry, but the auction started at 10:30 am today. The next catalogue will be available on Tuesday.");
}
}
if ((cdd-1) == add)
{
window.open(cat);
}
if ((cdd-2) == add)
{
if (achk > 630) {
window.open(cat);
}
else {
alert("The catalogue is normally loaded by 10:30 am today please check back then.");
}
}
}
if ((cdm-1) == adm) {
if(cdd == 2)
{
if (adld == add) {
window.open(cat);
}
}
if (cdd == 1)
{
if (add >= (adld-1)) {
window.open(cat);
}
}
}
}
**********
window.open works fine (but opens a new window) window.location/window.self/window.??? give the error message
Andy
Sorry forgot about your code.
Leave it with me.
Si
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks