开发者

Not interpret html in iframe but get the information from the html

In order to reduce the time of executing, we decide not to show the table in the iframe as the client cant see it. But we have to copy the contents of t开发者_如何学Che table so as to update the table in the main page (which can be seen by the client).

The principle is that, the iframe shouldn't interpret html, but through a function written by JavaScript, we copy the updated table to the main page. We've thought about commenting the html out in the iframe, but it'll be very complicated as we could not get the element by Document.getElementById(Id). And we'll have to parser the html. Does anybody do similar things?


Is the document you're requesting on the same domain as the "main page"? If so, you can request the second document via AJAX and use a regular expression to extract the element from it. This is all done without rendering any additional content to the DOM.

Once you have the table element extracted from the AJAX response, you can add it to the main page DOM.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜