SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    SitePoint Guru siphilp's Avatar
    Join Date
    Nov 2001
    Location
    Fife, Scotland
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could you please post your code.

    regards


    Si

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    SitePoint Guru siphilp's Avatar
    Join Date
    Nov 2001
    Location
    Fife, Scotland
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry forgot about your code.

    Leave it with me.


    Si


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •