0

我发布代码时出现错误:您的帖子似乎包含未正确格式化为代码的代码。

代码:

<!DOCTYPE html>  <html> 
    <head> 
    <title>test</title> 

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" />
    <link rel="stylesheet" href="css/colors.css">
      <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>

    <script>     
     // Global declarations - assignments made in $(document).ready() below
        var varHeaderView11 = null;

        var varContentView11 = null;
        var varContentView12 = null;

        var varFooterView11 = null;

    </script> 

</head>  <body> 

<!-- Page 1 starts here --> <div data-role="page" data-theme="b" id="page1">

    <!-- view 11-->
    <div data-role="header" id="headerView11" name="headerView11" data-nobackbtn="true">
        <h1>header</h1>
    </div>
    <div data-role="content" id="contentView11" name="contentView11">    

        <form id="formView11">
            <fieldset class="ui-grid-b"> 
                <div align="center" class="ui-block-a"><button onclick="button1View11()">btn1V11</button></div>
                <div align="center" class="ui-block-b"><button onclick="button2View11()">btn2V11</button></div>
                <div align="center" class="ui-block-c"><button onclick="button3View11()">btn3V11</button></div>


<!--
                <div align="center" class="ui-block-a"><a id="button1View11" name="button1View11" data-role="button" data-inline="true">btn1V11</a></div>
                <div align="center" class="ui-block-b"><a id="button2View11" name="button2View11" data-role="button" data-inline="true">btn2V11</a></div>
                <div align="center" class="ui-block-c"><a id="button3View11" name="button3View11" data-role="button" data-inline="true">btn3V11</a></div>

-->

            </fieldset>

            <div align="right"><img id="image1View11" name="image1View11" src="img/1.png"/></div>

            <div id="textField1View11" data-role="fieldcontain">
                <label for="inputText1View11" id="labelTextField1View11" name="labelTextField1View11">labelTextField1View11</label>        
                <input id="inputText1View11" name="inputText1View11" type="text" />
            </div>
            <div id="textField2View11" data-role="fieldcontain">
                <label for="inputText2View11" id="labelTextField2View11" name="labelTextField2View11">labelTextField2View11</label>        
                <input id="inputText2View11" name="inputText2View11" type="text" />
            </div>

            <fieldset class="ui-grid-a">
                <div class="ui-block-a"><a id="submitView11" name="submitView11" data-role="button" type="submit" value="submit" data-inline="true">submitView11</a></div>
                <div class="ui-block-b"><a id="resetView11" name="resetView11" data-role="button" type="reset" value="reset" data-inline="true">resetView11</a></div>
            </fieldset>

            </form>
    </div>
    <div data-role="footer" id="footerView11" name="footerView11">
                <fieldset class="ui-grid-b">
                    <div align="left" class="ui-block-a"><a id="buttonFooter1View11" name="buttonFooter1View11" data-role="button" data-inline="true">Footer1</a></div>
                    <div align="center" class="ui-block-b"><a id="buttonFooter2View11" name="buttonFooter2View11" data-role="button" data-inline="true">Footer2</a></div>
                    <div align="right" class="ui-block-c"><a id="buttonFooter3View11" name="buttonFooter3View11" data-role="button" data-inline="true">Footer3</a></div>
                </fieldset>

    </div>


    <!-- view 12-->
    <div data-role="content" id="contentView12" name="contentView12">    

            <div align="center"><img id="image1View12" name="image1View12" src="img/2.png"/></div>

    </div>


    <script>
        $(document).ready(function() {
            // Assign global variables
            varHeaderView11 = $('#headerView11');

            varContentView11 = $('#contentView11');
            varContentView12 = $('#contentView12');

            varFooterView11 = $('#footerView11');

            //set up the first view    
            hideView12();
        }); 

        //functions show and hide
        function showView11 {
            varHeaderView11.show();
            varContentView11.show();        
            varFooterView11.show();
        }
        function showView12 {
            varContentView12.show();
        }
        function hideView11 {
            varHeaderView11.hide();
            varContentView11.hide();        
            varFooterView11.hide();
        }
        function hideView12 {
            varContentView12.hide();
        }

    </script> </div>  <!-- Page1 ends here -->


</body> </html>
4

1 回答 1

2

错误控制台(CTRL+MAJ+J)非常清楚:

SyntaxError: missing ( before formal parameters

function showView11 {

函数声明可能缺少几个字符...

于 2012-08-20T10:12:25.133 回答