这个ajax程序在本地可以运行,上传后FIREFOX只能执行CLICK1

xiaoniaodejiao 2009-03-20 02:54:31

<!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>
<script language="javascript" src="jquery.min.js"></script>
<script type="text/javascript">
var indexdata;
$(document).ready(function(){
$("#click1").click(function(){
indexdata='news.json';
showdata();
})
$("#click2").click(function(){
indexdata='web.json';
showdata();
})
})
function showdata(){
$.ajax({
url:indexdata,
type:'GET',
dataType:'json',
timeout:10000,
error:function(){
alert('异步通讯失败!!');
},
success:function(json){
$("#show").html(json[0].text);
}
})
}
</script>
</head>
<body style="background-color:#cccccc;">
<div id="show" style="border:1px solid #000000;width:200px;height:300px;margin-left:auto;margin-right:auto;">1231333</div>
<div style="width:200px;height:50px;margin-left:auto;margin-right:auto;"><input type="button" value="按钮1" id="click1"></input><input type="button" value="按钮2" id="click2" ></input></div>
</body>
</html>

这是怎么回事,我是个菜鸟,难道说是传说中的缓存在作怪!!求待高手指点!
...全文
54 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

52,782

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧