求助啊 在谷歌浏览器里 为什么 JavaScript的跳转页面 代码不好使呢?
test.htm:
<input type="button" name="" value="go go go" onclick="javascript:gogo();">
<script type="text/javascript">
<!--
function gogo() {
location.href('test2.htm');
}
/ -->
</script> test2.htm:
<table cellpadding="0" cellspacing="0" border="0" width="hello" align="center" valign="middle">
<tr>
<td>hello </td>
</tr>
</table>
ie 里面好使 GOOGLE怎么也不好使
可是怎么点击按钮 也不动啊 气死人了
大虾帮忙
test.htm:
<input type="button" name="" value="go go go" onclick="javascript:gogo();">
<script type="text/javascript">
<!--
function gogo() {
location.href('test2.htm');
}
/ -->
</script> test2.htm:
<table cellpadding="0" cellspacing="0" border="0" width="hello" align="center" valign="middle">
<tr>
<td>hello </td>
</tr>
</table>
ie 里面好使 GOOGLE怎么也不好使
可是怎么点击按钮 也不动啊 气死人了
大虾帮忙
// -->
这样呢?
可是 这个符号 在JavaScript 里面干什么用的啊?
不明白 ; 赐教
所以根本没在意这个
但是JS认不了.
所以要写成
<!--
//-->
这样其中的代码就会给HTML解释的时候忽略掉.不会形成结点.但是对某些使用XHTML的框架.不加的话.里面的<>&?等等符号会给服务器解释.出现错误.
因为有些浏览器的低版本不支持javascript
<!--
//-->
用来隐藏之间的内容,以免在一些不支持javascript的浏览器中将代码显示出来