The requested URL /undefined was not found on this server
I have the following code:
<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;
});
When I click on the button I get the error:
The requested URL /undefined was not found on this server.
Here's what I have in my 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>
What is the issue?
There's no href
property in the object passed to $.fancybox
. Try adding this after 'type' : 'iframe'
(you'll need a comma after 'iframe'
, too, of course):
'href' : $(this).attr('href')
try using absolute path instead of relative path !
try checking the Apache error log, perhaps you can get some more info about the error there. try running only the PHP script and check if it succeed !
精彩评论