2011-04-23 313 views
1

我有以下代碼:所請求的URL /未定義在此服務器上找到

<a class="quickrate lightGreyBtn" href="selectmovie.php">Launch Quick Rate</a> 

//this is inside my javascript 
$(".lightGreyBtn").click(function() { 
     $.fancybox({ 
       'width' : '75%', 
       'height' : '75%', 
       'autoScale' : false, 
       'transitionIn' : 'none', 
       'transitionOut' : 'none', 
       'type' : 'iframe' 
     }); 

     return false; 
    }); 

當我按一下按鈕我得到的錯誤:

The requested URL /undefined was not found on this server. 

下面是我在我selectmovie.php

<body id="quickstart"> 
     <div id="dialog" style="display: block;"> 
      <div> 
       <h1><strong>Rate <span class="number">10</span> movies you like</strong> and start finding new favorites.</h1> 
       <ul class="items"> 
        <li data-page="1"> 
         <ul class="clearfix quickstart objects"> 
           <?php 
            $db = new PDO("mysql:host=localhost;dbname=test;",'root','test'); 
            $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
            $db->beginTransaction(); 
            $result = $db->prepare("SELECT MID, TITLE, URL FROM movie WHERE YEAR = ? AND URL != ? ORDER BY RAND() LIMIT 8");  
            $result->execute(array(2011, 'http://cdn-5.nflximg.com/us/boxshots/large/70144645.jpg')); 
            $movies = $result->fetchAll(PDO::FETCH_ASSOC); 
            foreach ($movies as $movie) 
            { 

             //create some html code using echo here 
            } 
           ?> 
         </ul> 
        </li> 
       </ul> 

       <a href="#" data-page="1" data-nexttoken="1301018340333" data-total="135" data-seed="1301018340333" class="next newBlue">More Movies »</a> 
      </div> 
     </div> 


</body> 

問題是什麼?

+0

什麼給你的錯誤:PHP或JS? – Blender 2011-04-23 06:02:08

+0

這就是我試圖找出..它彈出的的fancybox和錯誤我得到的是發生看中箱 – aherlambang 2011-04-23 06:05:40

回答

0

有傳遞給$.fancybox對象沒有href屬性。嘗試​​後加入這個('iframe'後,你需要一個逗號,也當然):

'href' : $(this).attr('href') 
0

嘗試使用,而不是相對路徑絕對路徑!

嘗試檢查Apache的錯誤日誌,也許你能得到有關的錯誤一些更多的信息。 嘗試只運行PHP腳本並檢查它是否成功!

+0

同樣的事情裏面 – aherlambang 2011-04-23 06:05:17

相關問題