我有此腳本我怎麼解決這阿賈克斯PHP腳本
說index.html
<html>
<head>
<title>Ajax with jQuery Example</title>
<script type="text/JavaScript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
setInterval(function(){
$("#quote p").load("script.php");
}, 10000);
});</script>
<style type="text/css">
#wrapper {
width: 240px;
height: 80px;
margin: auto;
padding: 10px;
margin-top: 10px;
border: 1px solid black;
text-align: center;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="quote"><p> </p></div>
</div>
</body>
</html>
的script.php
<?php
echo "Hello how are you";?>
加載index.html的它,當
是空白的10秒,那麼它開始運作..如何擺脫空白,以及如何在瀏覽器加載時立即顯示?
你確實意識到你正在設置10秒的時間間隔,因此爲什麼你在10秒內什麼也看不到? – martynthewolf 2011-05-26 08:58:16