日期:2014-05-16  浏览次数:20324 次

js怎样根据初始级别与结束级别得出钱与天数,根据1-60级写1-70级
这是1-60的代码
  Itemarray   =   new   Array
(
new   Array(1,   0,   0),      
new   Array(2,   1,   1),
new   Array(3,   1,   1),
new   Array(4,   1,   1),
new   Array(5,   1,   1),
new   Array(6,   1,   1),
new   Array(7,   1,   2),
new   Array(8,   1,   2),
new   Array(9,   1,   2),
new   Array(10,   1,   3),
new   Array(11,   1,   3),
new   Array(12,   1,   3),
new   Array(13,   1,   4),
new   Array(14,   2,   4),
new   Array(15,   2,   4),
new   Array(16,   3,   5),
new   Array(17,   3,   5),
new   Array(18,   3,   6),
new   Array(19,   3,   6),
new   Array(20,   4,   7),
new   Array(21,   5,   7),
new   Array(22,   5,   8),
new   Array(23,   5,   9),
new   Array(24,   5,   9),
new   Array(25,   5,   10),
new   Array(26,   5,   10),
new   Array(27,   5,   11),
new   Array(28,   5,   11),
new   Array(29,   6,   12),
new   Array(30,   6,   12),
new   Array(31,   6,   12),
new   Array(32,   6,   12),
new   Array(33,   7,   13),
new   Array(34,   7,   13),
new   Array(35,   7,   13),
new   Array(36,   7,   13),
new   Array(37,   9,   14),
new   Array(38,   9,   14),
new   Array(39,   9,   14),
new   Array(40,   9,   15),
new   Array(41,   10,   15),
new   Array(42,   10,   15),
new   Array(43,   10,   16),
new   Array(44,   10,   16),
new   Array(45,   11,   17),
new   Array(46,   11,   18),
new   Array(47,   12,   19),
new   Array(48,   12,   20),
new   Array(49,   12,   21),
new   Array(50,   12,   22),
new   Array(51,   13,   23),
new   Array(52,   13,   24),
new   Array(53,   14,   26),
new   Array(54,   14,   26),
new   Array(55,   15,   28),
new   Array(56,   15,   28),
new   Array(57,   18,   30),
new   Array(58,   18,   30),
new   Array(59,   21,   32),
new   Array(60,   21,   32)
);
 
function   activate(form)
{
var   StartLevel   =   form.StartLevel.value;
var   EndLevel   =   form.EndLevel.value;
if   ((StartLevel   ==   " ")   |   (EndLevel   ==   " "))  
{
alert( "Please   Enter   Your   Start   and   Target   Level ");
form.StartLevel.focus();return   false;
}
StartLevel   =   StartLevel*1;
EndLevel   =   EndLevel*1;   //   convert   string   to   number
if   (StartLevel   >   EndLevel)
{
alert( "Target   level   must