这最终令人沮丧,因为它在开发站点上工作,但在将其移动到实时站点后,它停止工作。:S
$('.menu_btn').click(function(e) {
//rel is used to tell me what html page to load
var url = $(this).attr('rel');
//load the new page into the div
$('#ajax_wrapper').load(url);
});
更令人沮丧的是,当我硬编码 url 的值时:
var url = 'http://www.example.com/pages/home.html'
它可以正常工作。
添加一个alert(url)
给我正确的rel地址。