开发者

Error Saving the Content of an Iframe By php

var htmll = $("#iframe1").html();
alert(htmll);
$("#myTextarea")
         .val(htmll)
         .parents("form")
         .submit();

I am getting the

alert(html1);

as blank. The location of iframe in the HTML is

开发者_运维知识库
<body>
<iframe id="iframe1" src="load.php?sinput=<?php echo $_GET['sinput'] ?>" > </iframe>
</body>


I dunno about your JQuery code, but I know you could do something like

document.getElementById("iframe1").contentDocument.body.innerHTML

BUT, if this isn't in the same domain as the page you're executing this from, then you're going to get a security exception.

If you're trying to screen scrape, you're going to have to be more clever than that. Also, this isn't actually a PHP question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜