阿拉伯语在手机屏幕中显示效果不佳

时间:2014-08-10 07:01:07

标签: jquery jquery-mobile cordova

这是jQuery移动应用程序在阿拉伯语中显示一些信息,但它没有在android(eclipse,设备)中显示阿拉伯语,那不知道问题,有什么最佳解决方案呢?

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

        <meta name="viewport" content="width=device-width,initial-scale=1"/>
     <link rel="stylesheet" href="Scripts/jquery.mobile-1.3.2.min.css" />
         <script src="Scripts/jquery-2.1.1.js"></script>

        <script src="Scripts/jquery.mobile-1.3.2.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="Scripts/cordova-2.3.0.js"></script>


        <script type="text/javascript">




            function Calc() {

                var My_killo_first = $('#pageone #page2main #cols #Form1 #Ul1 li #ftxt').val();

                var My_killo_second = $('#pageone #page2main #cols #Form1 #Ul1 li #stxt').val();

                var price1 = 0.075;
                var price2 = 0.145;
                var price3 = 0.16;
                var price4 = 0.24;
                var price5 = 0.34;
                var price6 = 0.6;
                var price7 = 0.74;
                var sum = 0;
                var Reset = 0;

                var My_Killo = Math.abs(My_killo_first - My_killo_second);
                Reset = My_Killo;

                if (My_Killo >= 0 && My_Killo <= 50) {


                    $('#pageone #page2main #cols #Form1 #Ul1 li #cost').val(My_Killo * price1);
                    sum = My_Killo * price1;
                    return sum;
                }
                if (My_Killo >= 50 && My_Killo <= 100) {


                    $('#pageone #page2main #cols #Form1 #Ul1 li #cost').val(50 * price1 + (My_Killo - 50) * price2);
                    sum = 50 * price1 + (My_Killo - 50) * price2;
                    return sum;

                }


                if (My_Killo > 0 && My_Killo <= 200) { sum = My_Killo * price3; return sum; } else { sum = 200 * price3; reset = My_Killo - 200; }
                if (My_Killo > 200 && My_Killo <= 350) { sum = sum + (reset * price4); return sum; } else { sum = sum + (150 * price4); reset = My_Killo - 350; }
                if (My_Killo > 350 && My_Killo <= 650) { sum = sum + (reset * price5); return sum; } else { sum = sum + (300 * price5); reset = My_Killo - 650; }
                if (My_Killo > 650 && My_Killo <= 1000) { sum = sum + (reset * price6); return sum; } else { sum = sum + (350 * price6); reset = My_Killo - 1000; }
                if (My_Killo > 1000) { sum = sum + (reset * price7); return sum; }
            }


            $(document).ready(function () {

                $('#pageone #page2main #cols #Form1 #Ul1 li #ftxt').val(localStorage.getItem("f"));
                $('#pageone #page2main #cols #Form1 #Ul1 li #stxt').val(localStorage.getItem("s"));
                $('#pageone #page2main #cols #Form1 #Ul1 li #cost').val(localStorage.getItem("c"));

                $("#go").on("click", function (event) {

                    // Prevent the usual navigation behavior
                    event.preventDefault();

                    // Alter the url according to the anchor's href attribute, and
                    // store the data-foo attribute information with the url
                    $.mobile.navigate("#pageone");
                });



                $('#pageone #page2main #cols #Form1 #Ul1 li #cost').attr("readonly", true);

                $('#calcbtn').click(function () {
                    var f = $('#pageone #page2main #cols #Form1 #Ul1 li #ftxt').val();
                    var s = $('#pageone #page2main #cols #Form1 #Ul1 li #stxt').val();
                    var cost = " جنيها مصري " + Calc() + " ";

                    localStorage.setItem("c", cost);
                    localStorage.setItem("f", f);
                    localStorage.setItem("s", s);
                    //localStorage.setItem("s", "Alen");
                    $('#pageone #page2main #cols #Form1 #Ul1 li #cost').val(cost);




                });


            });

        </script>
        <style type="text/css">

           #pageone ,#page2,#home{
          background:url(image/back.jpg) no-repeat center center fixed;
          -webkit-background-size: cover;          
          -moz-background-size: cover;         
          -o-background-size: cover;          
           background-size: cover;
     }  
    </style>

    </head>
    <body lang="ar">
         <div data-role="page"  id="home" >


      <div id="page1main" data-role="main" class="ui-content">
          <div data-role="header" data-position="fixed" data-theme="b"> <h2>ط¨ط±ظ†ط§ظ…ط¬ ط­ط³ط§ط¨ ظپط§طھظˆط±ط© ط§ظ„ظƒظ‡ط±ط¨ط§ط،</h2></div>

    <div data-role="tabs">


        <ul id="two" class="tablist-content" data-role="listview" data-inset="true">
            <li data-theme="b"><a id="go"   >ط­ط³ط§ط¨ ظپط§طھظˆط±ط© ط§ظ„ظƒظ‡ط±ط¨ط§ط،</a></li>


        </ul>
    </div>
           <div data-role="footer" data-position="fixed" data-theme="b"> <h2>Telemedia.com</h2></div>
          </div>
           </div>
        <div data-role="page"  id="pageone" align="center">


      <div id="page2main" data-role="main" class="ui-content">
        <div id="cols" data-role="collapsible" data-collapsed="false" data-theme="b"  data-content-theme="c">
        <h4>ط­ط³ط§ط¨ ط§ط³طھط®ط¯ط§ظ…ظƒ ظپظٹ ط§ظ„ظƒظ‡ط±ط¨ط§ط،</h4>
             <form id="Form1">
        <ul data-role="listview" id="Ul1" data-inset="true">
            <li data-role="fieldcontain">
                <label for="name2">ظ‚ط±ط§ط،ط© ط§ظ„ط¹ط¯ط§ط¯</label><br />
                <input type="number" name="name2" id="ftxt" value="" data-clear-btn="true"> <label for="name2">كيلو وات</label>
            </li>
             <li data-role="fieldcontain">
                <label for="name2">ظ‚ط±ط§ط،ط© ظ…ط±ط¨ط¹ ط§ظ„ط­ط§ظ„ظٹط©</label><br />
                <input type="number" name="name2" id="stxt" value="" data-clear-btn="true">
            </li>
             <li data-role="fieldcontain">
                <label for="name2">ط§ظ„طھظƒظ„ظپط© ط§ظ„ط§ط¬ظ…ط§ظ„ظٹط©</label><br />
                <input type="text" name="name2" id="cost" value="" data-clear-btn="false">
            </li>
            <li class="ui-body ui-body-b">
                <fieldset class="ui-grid-a">
                    <legend></legend>
                        <div class="ui-block-b"><a id="calcbtn" data-inline="true" data-role="button" data-theme="a">ط§ط­ط³ط¨ ط§ظ„طھظƒظ„ظپط©</a></div>
                </fieldset>
            </li>
            </ul>
          </form>
         </div>
      </div>
    </div> 
  </body>
</html>

1 个答案:

答案 0 :(得分:0)

请务必将文件保存在UTF8 Charset中,您测试的Android版本是什么?