2013-03-09 18 views
3

我使用jQuery Mobile和標題說的一樣,出於某種原因,某些鏈接卡在加載微調框中,並且不打開下一頁。代碼如下:jQuery Mobile的一些鏈接卡在加載

<div data-role="page"> 
    <div data-role="content"> 
     <ul data-role="listview" data-theme="c" data-dividertheme="b"> 
      <li data-role="list-divider">Top News</li> 
       <?php 
       include_once ('simple_html_dom.php'); 
       $html = file_get_html('http://www.example.com'); 
       foreach ($html->find('*.overridable a[class=title]') as $main){ 
        echo '<li><a href="news.php?url='.urlencode($main->href).'" data-transition="slidedown">'.$main->plaintext.'</a></li>'; 
       } 
       ?> 
       <li data-role="list-divider">Other News</li> 
       <?php 
        include_once ('simple_html_dom.php'); 
        $html = file_get_html('http://www.example.com'); 
        foreach ($html->find('div[class=river-post yui-u] h2 a[href*=example]') as $ret){ 
         echo '<li><a href="othernews.php?url='.urlencode($ret->href).'" data-transition="slidedown">'.$ret->plaintext.'</a></li>'; 
        } 
       ?> 
      </ul> 
     </div> 

正如您所看到的,我將點擊的URL發送到下一頁並解析文章。出於某種原因,一個或兩個鏈接會卡在裝載微調器上。文章的數據與其他文章的格式相同,但不打開。但是當我擺脫jQuery並使用純HTML時,所有東西都會打開。該鏈接被髮送到URL並在下一頁獲得解析。任何想法爲什麼一些鏈接卡住了?

更新錯誤:

Uncaught SyntaxError: Unexpected token < jquery-1.8.2.min.js:2 
Uncaught ReferenceError: YChartsQuoteEmbed is not defined 

回答

0

最後想出了答案。問題在於我在我的news.php和othernews.php頁面上返回的HTML,其中一些內容是Javascript。我需要跳過這個Javascript,現在頁面加載得很好。被解析的Javascript代碼干擾了jQuery Mobile代碼。