在页面添加<div id="box"></div>
添加代码
document.getElementById('box').innerHTML = '当前定位城市:' + cityName
<!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/html charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
<!--
function CheckForm()
{
if (document.form.xxurl.value.length == 0) {
alert("Err:输入的网址不能为空!")
document.form.xxurl.focus()
return false
}
return true
}
-->
</script>
<body><table width="406" border="0" cellspacing="0" cellpadding="0">
<tr>
<form name="form" id="form" method="post" action="" onsubmit="return CheckForm()">
<td align="center">
<input name="xxurl" type="text" id="xxurl" size=42 maxlength=100 >
<input name="submit" type="submit" id="Eok" value="搜索一下"> </td>
</form>
</tr>
<tr>
<td height="36">提示信息位置</td>
</tr>
</table>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)