0
我已经通过这种方式(根据“jerjer”所选答案)尝试,但未能加载内容..如何使用PHP卷曲加载其他网站的内容到一个div在我的网站
render.php
<?php
$url = 'http://apps.irs.gov/app/withholdingcalculator/index.jsp';
$htm = file_get_contents($url);
echo $htm;
?>
common.js
$(document).ready(function(){
$('#divId').load('render.php');
});
index.html
<html>
<head>
<title>Home</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
<script src="js/jquery.js"></script>
<script src="js/common.js"></script>
</head>
<body>
<div id="divId"></div>
</body>
</html>
任何帮助吗?在此先感谢...
iframe。 iframe中。 dun dun dun – MightyPork
此代码无错误。 PHP脚本正确返回外部网站的内容? (没有错误?良好的路径?)尝试直接打开render.php到你的浏览器。 –
为什么要使用AJAX加载render.php?为什么不在你的索引中使用php? (so index.php),并在其中包含render.php。 –