我正在做一个从网站获取股票财产并将其显示在我的网站上的网站。但是我在显示它时遇到了问题。
这是代码:
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<iframe id="frame3" src="http://www.stockpart.net" sandbox="allow-forms allow-scripts allow-same-origin " style="visibility : hidden "></iframe>
<script>
$(document).ready ( function(){
$('#frame3').contents().find('.addClassClose').show();
});
</script>
我收到以下错误:
AD BLOCK NOT DETECTED
pop.js:1 rt():in true false tabunder 2
pop.js:1 rt():adv.bind http://serve.popads.net/servePopunder.php?cid=242978
pop.js:1 Uncaught SecurityError: Blocked a frame with origin "http://stockpart.net" from accessing a frame with origin "http://www.example.com". Protocols, domains, and ports must match.
无论如何,无论如何,我都可以在iframe中使用jQuery来获取其他网站类/ id的信息?
我在帕特里克·埃文斯(Patrick Evans)发表的帖子中进行了一些修改后找到了答案。
<?php
$homepage = file_get_contents('http://stockpart.net');
echo $homepage;
?>
然后将其iframe
放在主页上以获取库存信息
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句