Internet explorer 我想通过iframe显示文本文件,但它在IE中不起作用
我想通过iframe显示一个文本文件,但它在IE中不起作用。它在Mozilla Firefox中运行良好。有什么想法吗 下面是我的代码:Internet explorer 我想通过iframe显示文本文件,但它在IE中不起作用,internet-explorer,iframe,Internet Explorer,Iframe,我想通过iframe显示一个文本文件,但它在IE中不起作用。它在Mozilla Firefox中运行良好。有什么想法吗 下面是我的代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/plain; charset=ANSI" />
</head>
<body>
<iframe src='http://localhost/button3.txt'
scrolling='no' frameborder='0'
style='border:none; width:1300px; height:500px'></iframe>
</body>
</html>
button.txt包含用php编写的脚本。它不会显示脚本,而是执行脚本。我是php初学者。以下答案基于我在搜索时找到的内容: 将IFrame的src设置为PHP文件:
<iframe src='http://localhost/showTxt.php' scrolling='no' frameborder='0' style='border:none; width:1300px; height:500px'></iframe>
showTxt.php:
<iframe src='http://localhost/showTxt.php' scrolling='no' frameborder='0' style='border:none; width:1300px; height:500px'></iframe>
一,
或
二,
如果执行txt文件中的PHP代码,则服务器配置有问题。在那种情况下,这与IE无关。你百分之百确定会发生什么吗?但它不会发生在Mozilla中,即使在旧的MSIE6下也能工作。如果要打开从本地web服务器提供的HTML,请检查服务器配置。
<?php
$output=file_get_contents("test.txt");
highlight_string($output);
?>