我想从页面中获取document.write内的html,并加载,追加到另一个页面上的新div。这里是整个页面的源代码。我只是想拿到桌子追加到#newDIV获取页面内容,追加到脚本标记
<html>
<head>
<link rel="alternate stylesheet" type="text/css" href="resource://gre-resources/plaintext.css" title="Wrap Long Lines">
</head>
<body cz-shortcut-listen="true">
<pre>document.write('<table align="center" cellspacing="1" class="report" id="livescoring"><caption><span>Live Scoring</span></caption><tbody><tr><th>Week 19</th></tr><tr class="oddtablerow"><td><a target="_blank" href="http://www03.myfantasyleague.com/2016/live_scoring_summary?L=75656&W=19">Live Scoring Summary</a>\
</td></tr><tr class="eventablerow"><td><a target="_blank" href="http://www03.myfantasyleague.com/2016/live_scoring?L=75656&W=19">Live Scoring Details</a>\
</td></tr></tbody></table>');
</pre>
</body>
</html>
我想要得到的“预”中创建的文档写表标签
我想简单地将内容加载到使用.load新的div,但没有奏效
因此,这将呈现一个新的页面上这样
<div id="newDIV"><table align="center" cellspacing="1" class="report" id="livescoring"><caption><span>Live Scoring</span></caption><tbody><tr><th>Week 19</th></tr><tr class="oddtablerow"><td><a target="_blank" href="http://www03.myfantasyleague.com/2016/live_scoring_summary?L=75656&W=19">Live Scoring Summary</a>
现场打分详细
你可以重写你的问题更清楚。这并不是很清楚你在 –
之后感谢迈克尔,我已经这样做了,希望它更清楚 – MShack
让我看看我是否能够直接得到这个结果。您想要导航到另一个页面,在页面加载后,与您一起传输DOM元素并将其附加到该页面中的元素。是这个吗?这是我一整天听到的最疯狂的想法,在这里已经过了整整一天,哈哈。它不能完成,但有解决方法。 –