我的 javascript 代码不起作用。我去了页面,它正在显示内容。为什么不将数据附加到 .userStats?invest_process.php 包含获取 PHP 中显示的值的信息。这不是导致问题的原因。谢谢,代码如下。
HTML 代码:
<div id="content1" class="tabscontent">
<p>
<span class="userStats"></span>
</p>
</div>
JavaScript:
<script type="text/javascript">
var auto_refresh_stats = setInterval(
function (){
$('.userStats').load('get_user_stats.php').show();
}, 1000 );
</script>
PHP代码:
<?php
require 'invest_process.php';
echo
'<span><h3>You have:
' . $select_invested['amtInvested'] .
' Invested in GigaDice | You have:
' . $select_invested['amtInvested']/$select_invested_total['siteInvested']*100 .
' % of the site\'s bankroll</span></h3> <span><h3> You have
' . $select_balance_gg['gigagold'] .
' in GG Balance | You have profitted:
' . $siteProfit*$select_invested['amtInvested']/$select_invested_total['siteInvested'] .
'</span></h3>';
?>