如何获得javascript的最终结果?
我有一个包含大量javascript代码的html页面,例如,div的内容取决于数组的长度:如何获得javascript的最终结果?,javascript,jquery,Javascript,Jquery,我有一个包含大量javascript代码的html页面,例如,div的内容取决于数组的长度: for (var i = 0; i < movieList.length; i++) { document.body.appendChild(document.createElement('h2')).appendChild(document.createTextNode('title: ' + movieList[i].title)); var cUL = document.bod
for (var i = 0; i < movieList.length; i++) {
document.body.appendChild(document.createElement('h2')).appendChild(document.createTextNode('title: ' + movieList[i].title));
var cUL = document.body.appendChild(document.createElement('ul'));
cUL.appendChild(document.createElement('li')).appendChild(document.createTextNode(movieList[i].rating));
cUL.appendChild(document.createElement('li')).appendChild(document.createTextNode(movieList[i].year));
cUL.appendChild(document.createElement('li')).appendChild(document.createTextNode(movieList[i].length));
cUL.appendChild(document.createElement('li')).appendChild(document.createTextNode(movieList[i].isComedy));
cUL.appendChild(document.createElement('li')).appendChild(document.createTextNode('main characters: ' + movieList[i].mainCharacters.join(", ")));
}
for(变量i=0;i
我正在使用这些perlLWPx::ParanoidAgent
和HTML::Parser
模块来处理HTML代码,但我希望javascript脚本的结果可能就是您要寻找的。在大量其他内容中,您可以在JavaScript修改HTML后查看它。您需要:
后者有许多选项,包括和。问题是什么???你所说的
是什么意思?想要javascript的结果吗?结果是附加的元素。您的意思是$(窗口).on('load',function(){alert($('body').html());})代码>???很抱歉我不清楚,我需要一个完整的html文本,带有html中javascript的结果