2016-05-21 34 views
0

我正在嘗試使用PhoneGap預覽製作的這個有趣的聊天應用程序與Framework7。事情是,我以前從未使用過Framework7,並且在我的主頁面下將頁面鏈接在一起時遇到了困難。如何鏈接頁面與Framework7?

我有一個帶有<a href="">標籤的文本字符串,我想鏈接到一個表單供人註冊並在應用上創建他們的配置文件。我已經創建了一個單獨的html文件,我嘗試使用<a href="signup.html">進行鏈接,因爲這些示例顯示您可以執行該操作,但是當我測試它時,它不起作用,Chrome檢查員向我提供以下反饋:

framework7.min.js:23 XMLHttpRequest cannot load file:...Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

下面是我的代碼,底部的最後一個字符串是我試圖鏈接到表格的singup頁面,非常感謝您的幫助。

<!-- Status bar overlay for full screen mode (PhoneGap) --> 
    <div class="statusbar-overlay"></div> 
    <!-- Views --> 
    <div class="views"> 
     <!-- Your main view, should have "view-main" class --> 
     <div class="view view-main"> 
      <!-- Pages container, because we use fixed-through navbar and toolbar, it has additional appropriate classes--> 
      <div class="pages navbar-through toolbar-through"> 
       <!-- Page, "data-page" contains page name --> 
       <div data-page="index" class="page"> 
        <!-- Scrollable page content --> 
        <div class="page-content login-screen-content"> 
         <div class="login-screen-title"><img src="img/logo.png" width="130px" height="130px"></div> 
         <div class="login-screen-title">Welcome to<br>J Chat</div> 
         <p class="tour-content" style="text-align: center">Login below to get started!</p> 
         <form> 
         <div class="list-block"> 
          <ul> 
           <li class="item-content"> 
            <div class="item-inner"> 
             <div class="item-title label">Email</div> 
             <div class="input-inner"> 
              <input type="text" name="email" placeholder="E-Mail"> 
             </div> 
            </div> 
           </li> 
           <li class="item-content"> 
            <div class="item-inner"> 
             <div class="item-title label">Password</div> 
             <div class="input-inner"> 
              <input type="password" name="password" placeholder="Password"> 
             </div> 
            </div> 
           </li> 
          </ul> 
         </div> 

         <div class="list-block"> 
          <ul> 
           <li> 
            <a href="home.html" class="button button-intro login ripple">Login</a> 
           </li> 
          </ul> 
         </div> 

         <!-- Link to another page --> 
         <div class="list-block" style="margin-top: 1em;"> 
          <p class="tour-content"> 
           Don't have an account yet?<br> 
           <a href="signup.html">Click here</a> to sign up! 
          </p> 
         </div> 

        </form> 


       </div> 
       </div> 
      </div> 

      </div> 
     </div> 
+0

可能重複http://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local – Avijit

回答

0

是您的文件在您的本地服務器上?如果您壓縮文件夾並使用電話差距進行構建,則設備上的鏈接將起作用。但是,如果您要在桌面上預覽,則必須將dist文件夾放在本地服務器上。 我使用的是Apache,所以我將dist文件夾放在htdocs文件夾中,然後從瀏覽器導航到它,這對我很有用。