<html>
<body><script type="text/javascript">
var firstname;
firstname="George";
document.write(firstname);
document.write("<br />");
firstname="John";
document.write(firstname);
</script>
</body>
</html>
这段代码请过目~~ 其中第二个document.write输出的地方是("<br />"),有办法可以让变量和普通文本一同输出吗?不需要写两行输出,有没有方法类似于C++里面的 cout<<a<<"a is a varable"<<endl;
<body><script type="text/javascript">
var firstname;
firstname="George";
document.write(firstname);
document.write("<br />");
firstname="John";
document.write(firstname);
</script>
</body>
</html>
这段代码请过目~~ 其中第二个document.write输出的地方是("<br />"),有办法可以让变量和普通文本一同输出吗?不需要写两行输出,有没有方法类似于C++里面的 cout<<a<<"a is a varable"<<endl;
<html>
<body><script type="text/javascript">
var firstname;
firstname="George";
document.write(firstname);
document.write("\< br\ /> ");
firstname="John";
document.write(firstname);
</script>
</body>
</html>
<html>
<body><script type="text/javascript">
var name;
name="George";document.write("test page:"+name+" ");//test page 是普通字符串可行呀!!
name="John";
document.write(name);
</script>
</body>
</html>