由于您无法修改该文件,因此唯一的方法是将其包装在或中,并驱动从相邻/包含页面中的JavaScript进行搜索和滚动。
function go() {
// "line" is the for which line to jump to; see the HTML.
var line = document.getElementById('line').value;
if (document.body.createTextRange) { // This is IE
var range = frames['log'].document.body.createTextRange();
if (range.findText(line)) {
range.select(); // Scroll the match into view and highlight it.
}
} else { // Non-IE. Tested in Firefox; YMMV on other browsers.
frames['log'].find(line); // Scroll the match into view and highlight it.
}
}
Go
网上试试我测试过,在IE7和FF3;如果它没有编辑地在别处工作,我会感到惊讶,但你永远不知道你的运气!
显然在你的情况下,你会以编程方式驱动滚动而不是通过框,但你可以看到它如何为你工作。