dongmei8511 2013-08-31 22:20
浏览 53

jQuery.ajax不会调用脚本

My HTML file:

<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<script>
var session;
$.ajaxSetup({cache: false})
$.get('ajax2.php');
</script>
</body>

My ajax2.php file

mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("final") or die(mysql_error());
mysql_query("UPDATE `final` SET `phone_number` = `phone_number` + 1 WHERE `name` = 'gerg' ");

When I run ajax2.php it works just fine (increases the value by 1). However I can't access through ajax.html. Where is my mistake? Thank you.

  • 写回答

1条回答 默认 最新

  • doulianxi0587 2013-08-31 23:05
    关注

    Try putting a slash before the name of the file:

    $.get('/ajax2.php');
    
    评论

报告相同问题?

悬赏问题

  • ¥20 matlab计算中误差
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊