【发布时间】:2013-09-29 18:14:48
【问题描述】:
我已经尝试过这种方式(根据“jerjer”的选择答案)但未能加载内容..
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。框架。顿顿顿
-
这段代码没有错误。 php 脚本正确返回外部网站的内容? (没有错误?好路径?)尝试直接在浏览器中打开render.php。
-
为什么要使用AJAX来加载render.php?为什么不在索引中使用 php? (所以 index.php),只包括 render.php 那里。
-
我必须根据我的需要修改渲染的内容...意味着我需要扣除一些内容..
-
确保您的服务器允许 PHP 中的 cURL
标签: javascript php jquery curl