2014-04-10 4 views
0

jQuery 모바일에 대한 새로운 기능입니다. 내 프로젝트는 30 개의 화면으로 구성되어 있습니다. ++. 그래서 각 화면을 각각의 단일 HTML로 분리합니다. 하지만 이제는 코드바 .js를 프로젝트에 포함시켜야하기 때문에 한 가지 문제에 직면했습니다. 그래서 모든 html에 cordova.js를 포함시켜야합니까? 더 나은 해결책을 찾았습니까? codeova.js ~ 30 ++ html을 포함하려면 꽤 시간이 걸립니다.jQuery mobile multiple html

코드

<head> 
    <meta charset="utf-8"> 
    <title>Smart Realtor</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <meta name="apple-mobile-web-app-capable" content="yes"> 
    <meta name="apple-mobile-web-app-status-bar-style" content="black"> 

    <link rel="stylesheet" href="css/smartrealtor-theme.css" /> 
    <link rel="stylesheet" href="css/custom.css"> 
    <link rel="stylesheet" href="css/themes/default/jquery.mobile.structure-1.4.2.css"> 
    <link rel="stylesheet" href="css/themes/default/jquery.mobile.icons-1.4.2.css"> 
    <link rel="stylesheet" href="css/jqm-icon-pack-fa.css"> 

    <script src="js/jquery.js"></script> 
    <script src="js/globalsetting.js"></script> 
    <script src="js/jquery.mobile-1.4.2.min.js"></script> 
    <script src="cordova.js"></script> 
    <script src="Calendar.js"></script> 
    <script src="js/jquery.mobile.fastButtons.js"></script> 
</head> 

답변

0

JQuery와 모바일은 JQuery와 모바일 "페이지"를 제공합니다. 이 페이지는 동일한 파일에 포함될 수 있지만 별도의 파일에서도로드 할 수 있습니다.

JQuery 모바일 페이지를 사용하는 경우 모든 하위 페이지가 아니라 기본 페이지에 종속성 만 포함하면됩니다. Page Documentation

+0

안녕하세요. 정말로 이해합니다. 내 앱이 index.html, default1.html, default2.html로 구성되어 있다고 가정 해 보겠습니다. index.html에 cordova.js 만 포함하면됩니까? – user998405

+0

네, 페이지 문서를 따라야합니다. –