在html页面中显示javascript代码
在IE怪癖模式下,我想使用以下代码在html页面上显示一些javascript函数:在html页面中显示javascript代码,javascript,html,internet-explorer-6,Javascript,Html,Internet Explorer 6,在IE怪癖模式下,我想使用以下代码在html页面上显示一些javascript函数: document.write('<pre>' + someFunction + '</pre>'); 如何使其显示函数的完整源代码?将替换为将替换为您可以使用它们的html Rxpression,而不是使用那些“”符号 例如代替 这会解决你的问题。试试这个。不要使用“”符号,你可以使用它们的html Rxpression 例如代替 这会解决你的问题。试试这个。使用.replace(),
document.write('<pre>' + someFunction + '</pre>');
如何使其显示函数的完整源代码?将
替换为将
替换为
您可以使用它们的html Rxpression,而不是使用那些“”符号
例如
代替<和
代替>
这会解决你的问题。试试这个。不要使用“”符号,你可以使用它们的html Rxpression
例如
代替<和
代替>
这会解决你的问题。试试这个。使用.replace(),例如
函数foo(i){
如果(i<10){
警报(“酒吧”);
}
}
document.write(“+foo.toString().replace(“Use.replace(),例如
函数foo(i){
如果(i<10){
警报(“酒吧”);
}
}
document.write(“+foo.toString().replace(”
function a(j){
var i = 0;
if(i<j){
alert(j + ' is greater than zero');
}
}
function a(j){
var i = 0;
if(i
function foo(i) {
if (i < 10) {
alert("bar");
}
}
document.write("<pre>"+foo.toString().replace("<","<")+"</pre>");
function foo(i) {
if (i < 10) {
alert("bar");
}
}