标题:大家帮我看看这个代码initSeats是没有定义和findSeat是没有定义 本人刚学找 ...
只看楼主
维基解密
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-10-23
结帖率:0
 问题点数:0 回复次数:0 
大家帮我看看这个代码initSeats是没有定义和findSeat是没有定义 本人刚学找不到错误求大家帮忙
程序代码:
<html>

    <head>

        <title>Mandango - The Macho Movie Ticket Finder </title>



        <script type="text/javascript">

            var seats = [ false,true,false,true,true,true,false,true,false ];

            var selSeat = -1;



            function initSeats() {

                // Initialize the appearance of all seats

                for (var i = 0; i < seats.length; i++) {

                    if (seats[i]) {

                        //

                        document.getElementById("seat" + i).src = "seat_avail.png";

                        document.getElementById("seat" + i).alt = "Available seat";

                    }

                    else {

                        //

                        document.getEementById("seat" + i) .src = "seat_unavail.png";

                        document.getElementById("seat" + i).alt = "Unavailble seat";

                    }

                }

            }



            function findSeat() {

                //

                if (selSeat >= 0) {

                    selSeat = -1;

                    initSeats();

                }



                //

                for (var i = 0; i < seats.length; i++) {

                    //

                    if (seats[i]) {

                        selSeat = i;

                        document.getElementById("seat" + i).src = "seat_select.png";

                        document.getElementById("seat" + i).alt = "Your seat";

                        //

                        var accrpt = confirm("Seat" + (i + 1) + "is available.Accrpt?");

                        if (!accept) {

                            //

                            selSeat = -1;

                            document.getElementById("seat" + i) .src = "seat_avail.png";

                            document.getElementById("seat" + i).alt = "Available seat";

                        }

                    }

                }

            </script>

        </head>



        <body onload="initSeats();">

            <div style="margin-top:75px; text-align:center">

                <img id="seat0" src="" alt="" />

                <img id="seat1" src="" alt=""


 />

                                <img id="seat2" src="" alt="" />

                <img id="seat3" src="" alt="" />

                <img id="seat4" src="" alt="" />

                <img id="seat5" src="" alt="" />

                <img id="seat6" src="" alt="" />

                <img id="seat7" src="" alt="" />

                <img id="seat8" src="" alt="" />

                <input type="button" id="findseat" value="Find Seat" onclick="findSeat();" />

            </div>

        </body>

    </html>

搜索更多相关主题的帖子: javascript html Movie title 
2011-10-31 16:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-353914-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.317450 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved