我正在调用网址以获取div
中的内容。我正在使用javascript函数来调用它。我正在使用此代码
<div class="portlet" data-id="prt2">
<div class="portlet-header">Reporting</div>
<div class="portlet-content" id="divEmployeeReportingWidget"></div>
</div>
<script>AjaxPage('../home/pages.php?page=Dashboard_EmployeeReporting', 'divEmployeeReportingWidget');</script>
,功能在这里:
function AjaxPage(url, containerid)
{
$("#"+containerid).html('<br /><br /><div align="center"><img src="images/loading.gif" /></div><br /><br />');
var j = $("#"+containerid).load(url);
}
并且page.php在这里:
if($_REQUEST['page'] == 'Dashboard_EmployeeReporting'){
echo '<div class="portlet-content" id="divEmployeeReportingWidget"><table border="0" cellspacing="0" cellpadding="3" width="98%" align="center">
<tbody><tr><td style="width:100px;" valign="top">Report To:</td><td class="main2"><span style="font-weight:bold;"><img src="../images/icons/iconUser.gif" style="float:left"> John Smith<br></span></td></tr>
<tr><td valign="top">Reporting To Me:</td><td class="main2"><span style="font-weight:bold;"></span></td></tr>
</tbody></table></div>';
}
我无法获得内容。我怎么能这样做?