这是一个测试页面。有一个按钮,点击应该将整个外部页面extern2.php加载到内容div中。 Extern2.php同时适用于Safari和Firefox,但index.php仅适用于Safari。Jquery/Ajax在Safari中工作但不是Firefox
主要页面:
jQuery Ajax Testfunction foo() {
$('#content').load('extern2.php', function() {
alert('Load was performed.');
});
}
if(isset($_POST['formSubmit']))
{
?>
$(document).ready(function() {
$('#content').load('extern2.php');
});
}
?>
外部页面:
// Connecting to database
$con = mysql_connect('CONNECT INFO HERE');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("CONNECT INFO HERE", $con);
$userID=2;
$getPage="SELECT * FROM pages,thumbnails WHERE thumbnails.thumbnailID=pages.thumbnailID AND pages.userID=".$userID." AND pages.projectID='8' LIMIT 3";
$pageResult = mysql_query($getPage) or die(" ". mysql_error());
?>
while($line = mysql_fetch_array($pageResult)) {
$thumb = $line['fileName'];
$title = $line['title'];
$link = $line['url'];
echo "";
}
?>
mysql_close($con);
?>