您正在发送POST AJAX请求,因此请
$albumname =$_POST['album'];在您的服务器上使用来获取值。我也建议您这样编写请求,以确保正确的编码:
$.ajax({ type: 'POST', url: 'test.php', data: { album: this.title }, success: function(response) { content.html(response); }});或简称为:
$.post('test.php', { album: this.title }, function() { content.html(response);});如果您想使用GET请求:
$.ajax({ type: 'GET', url: 'test.php', data: { album: this.title }, success: function(response) { content.html(response); }});或简称为:
$.get('test.php', { album: this.title }, function() { content.html(response);});现在您可以在服务器上使用了
$albumname = $_GET['album'];。不过请小心AJAX
GET请求,因为某些浏览器可能会将它们缓存。为了避免缓存它们,您可以设置
cache: false设置。



