新手求解答——哪里的问题,问什么报错??

1.

<body>
<frameset cols="250,*" frameborder="0">
   <frame src="4.html" name="formFrame" />
   <frame src="about:blank" name="resultsFrame" />
</frameset>
</body>

2.

<script type="text/javascript">
var timeDiff;
var selectedCity;
var daylightSavingAdjust = 0;

function updateTimeZone()
{
    var theCity = document.form1.lstCity;
     timeDiff = theCity.options[theCity.selectedIndex].value;
    selectedCity = theCity.options[theCity.selectedIndex].text;
    updateTime();
}
function getTimeString(dateObject)
{
    var timeString;
    var hours = dateObject.getHours();
    if(hours<10)
    
        hours = "0"+ hours;
        var nimutes = dateObject.getMinutes();
        if(minutes < 10)
        minutes = "0"+minutes;
        var seconds = dateObject.getMinutes();
        if(seconds<10)
        seconds = "0"+seconds;
        timeString = hours + ":"+minutes +":"+ seconds;
        return timeString;
}
function updateTime()
{
    var  nowTime = new  Date();
    var  resultsFrame = window.top.resultsFrame.document;
    resultsFrame.open();
    resultsFrame.write("Local Time is "+getTimeString(nowTime)+"<br>");
    nowTime.setMinutes(nowTime.getMinutes()+nowTime.getTimezoneOffset()+parseInt(timeDiff)+daylightSavingAdjust);
    resultsFrame.write(selectedCity+" time is "+getTimeString(nowTime));
    resultsFrame.close();
}
function chkDaylightSaving_onclick()
{
    if(document.form1.chkDaylightSaving.checked)
    {
        daylightSavingAdjust = 60;
    }
    else
    {
        daylightSavingAdjust =0;
    }
    updateTime();
}
 
</script>  
</head>

<body onload="updateTimeZone()">
<form name="form1">
<select size="5" name="lstCity" onchange="updateTimeZone();">
   <option value="60" selected="selected">Berlin</option>
   <option value="330">Bombay</option>
   <option value="0">London</option>
   <option value="180">Moscow</option>
   <option value="-300">NewYork(EST)</option>
   <option value="60">Pairs</option>
   <option value="-480">San Francisco(PST)</option>
   <option value="600">Sydney</option>
</select>
<p>
It's summertime in the selected city and its country adjusts for summertime daylight saving
<input type="checkbox" name="chkDaylightSaving"  onclick="return chkDaylightSaving_onclick()" />
</p>
</form>
</body>

568bbac30001540c03930136.jpg

568bbac700017dfa02940153.jpg

568bbac80001e62d05000099.jpg


qq_无心_12
浏览 1308回答 3
3回答

qq_无心_12

求指点

qq_无心_12

为什么还没有人看到,我还没有搞定哦
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript