Results 1 to 2 of 2
  1.    #1  
    //the function Nrizis() can not work.I can not find the erro! Please help me.
    var yy="2013";
    var ny="11/10/2013 15:30";
    var dl="01/0101/0501/2002/0402/1803/0503/2004/0404/2005/";
    var tl="00:0013:1606:2600:1920:1518:1919:0923:0506:1416:2805:2920:4413:3307:0900:4017:1408:0520:3306:221 2:3115:4115:4513:0808:2102:0500:00";

    function Mid(mainStr, starnum, endnum) {
    if (mainStr.length >= 0) {
    return mainStr.substr(starnum-1, endnum);
    } else {
    return null;
    }
    //mainStr.length
    }
    //======================================date
    function CDate(DateStr) {
    var converted = Date.parse(DateStr);
    var myDate = new Date(converted);
    if (isNaN(myDate)) {
    //var delimCahar = DateStr.indexOf('/')!=-1?'/':'-';
    var arys = DateStr.split('-');
    myDate = new Date(arys[0], --arys[1], arys[2]);
    }
    return myDate;
    }
    function Nrizis(snian, nlyj, d, t){
    var nianx,aa;
    var nianxs;
    var yue=[];
    var ye=[];
    //var nrizis;
    //---------------------------;
    nianx = (snian - 3) % 60;
    if (nianx === 0) {
    nianx = 60;
    yue[1] = "1/1/" + snian + " " + Mid(t, 1, 5);
    yue[2] = Mid(d, 16, 5) + "/" + snian + " " + Mid(t, 16, 5);
    ye[1] = CDate(yue[1]);
    ye[2] = CDate(yue[2]);
    if (nlyj >= ye[1] && nlyj < ye[2]) {
    //nrizis = nianx - 1;
    aa= nianx - 1;
    } else {
    aa= nianx;
    //nrizis = nianx;
    }
    }
    return aa;
    }

    document.write(Nrizis(yy,ny,dl,tl));
  2. #2  
    Try debugging your code on JSLint,The JavaScript Code Quality Tool

    It's very good and powerful for debugging Javascript code!

Similar Threads

  1. GPS gets undefined coordinates. Help!
    By xpentor in forum Palm Pre and Pre Plus
    Replies: 7
    Last Post: 05/29/2011, 09:56 AM
  2. Preware: Cannot call method 'split' of undefined.
    By ls1mtz in forum Palm Pre and Pre Plus
    Replies: 0
    Last Post: 01/08/2010, 10:28 AM
  3. TypeError: Cannot read property 'remove' of undefined
    By Equilibrium in forum webOS Development
    Replies: 0
    Last Post: 10/10/2009, 03:45 PM
  4. HsExt68KShims.c, Line:43xx, Undefined Handspring trap
    By t-vin in forum Palm OS Devices & Apps
    Replies: 0
    Last Post: 09/06/2004, 04:04 PM
  5. HsExt68KShims.c, Line:43xx, Undefined Handspring trap
    By t-vin in forum Palm OS Devices & Apps
    Replies: 0
    Last Post: 09/06/2004, 04:03 PM

Posting Permissions