Html链接加载但不起作用

时间:2015-03-29 20:04:50

标签: html5 jquery-mobile

      <!DOCTYPE html> 
        <html>
        <head>
        <title>Astro Tools</title>
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1' name='viewport'/>
        <link rel="stylesheet" href="js/jquery.mobile-1.4.3.min.css" type="text/css"/>
        <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>
        <script src="js/jquery.mobile-1.4.3.min.js" type="text/javascript"></script>
        </head>

        <body>

         <div data-role="page">

            <div data-role="header">
                <h1>Astrophoto Tools</h1>
            </div>


            <div data-role="content">

                <p>
                    Welcome to Astrophoto Tools. These simple calcualting tools will help you to avoid Star Trials.
                </p>

                <ul data-role="listview" data-inset="true">
                <li><a href="basic.html">Basic Tool</a></li>
                <li><a href="adv.html">Advanced Tool</a></li>
                <li><a href="hlp.html">Help</a></li>
                <li><a href="abt.html">About</a></li>
                </ul>
            </div>
        </div>
            <div data-role="footer">
                <h4>Footer</h4>
            </div>

        </div>

        </body>
        </html>
///////////////////////////////////////////////////////////////////////////////
Here is the basic.html 
////////////////////////

    <!DOCTYPE html> 
    <html>
    <head>
    <meta charset="utf-8">
    <meta content='width=device-width, initial-scale=1' name='viewport'/>
    <title>jQuery Mobile Web App</title>
    <link rel="stylesheet" href="js/jquery.mobile-1.4.3.min.css" type="text/css"/>
    <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="js/jquery.mobile-1.4.3.min.js" type="text/javascript"></script>
    <script>
    $(document).ready(function() {
        $("#lens").on("keyup", function () {
        var lens = $(this).val();
        //var fullframe = 0;  // initialize the sum to zero
        var fullframe = 600 / lens;
        $('#fullframe').val(fullframe.toFixed(2));
        var apsccanon = 600 / (lens * 1.6);
        $('#apsccanon').val(apsccanon.toFixed(2));
        var apscnikon = 600 / (lens * 1.5);
        $('#apscnikon').val(apscnikon.toFixed(2));
        var apscolympus = 600 / (lens * 2.0);
        $('#apscolympus').val(apscolympus.toFixed(2));

        });
    });
    </script>
    <style type="text/css">
    body,td,th {
        color: #CCC;
    }
    </style>
    </head>  


    <body> 

    <div data-role="page" id="page" data-theme="b">
        <div data-role="header">
             <h3 style="color:#3CF">Astrophoto Tool</h3>

        </div>
        <div data-role="content">
          <div align="center" style="color:#0F0">No Star Trails Exposure</div>
          <p align="center" style=" color:#FFFF00">Rule 600 </p>
        </div>

        <div data-role="content" data-theme="b">
            <form action="">Lens: Focal  Length (mm)
                <br>
                <input type='text' id='lens' style="color:#FF6"/>
                <br>Full Frame: (Time in Seconds)
                <br>
                <input type='text' id='fullframe' value="" style="color:#0F0" readonly>
                <br>APS-C (Canon): (Time in Seconds)
                <br>
                <input type='text' id='apsccanon'  value="" style="color:#0F0" readonly />
                <br>APS - C (Nikon/Sony/Pentax): (Time in Seconds)
                <br>
                <input type='text' id='apscnikon' value="" style="color:#0F0" readonly />
                <br>APS - C (Olympus/Panasonic): (Time in Seconds)
                 <input type='text' id='apscolympus' value="" style="color:#0F0" readonly />


                <input name="Reset" type="reset" value="Reset">
            </form>
        </div>

    <div data-role="footer">
            <h4 style="color:#3CF">&copy; Ranjan Mitra 2015</h4>
      </div>
    </div>
    </div>

    </body>
    </html>

当我运行basic.html时,它没有问题,但每当我点击index.html中指向basic.html的链接时,计算根本不起作用。我哪里错了?请帮忙。 ////////////////////////////////////////////////// //////////////////////

1 个答案:

答案 0 :(得分:-1)

您错过了第一个value=""

中的<input>
<input type='text' id='lens' ???? style="color:#FF6"/>
                <br>Full Frame: (Time in Seconds)