为什么在Drupal 7中如果我在hook_menu中有以下内容:
function dash_menu() {
...
...
$menuitems['mytest/feed/feedbackid/'] = array(
'type' => MENU_CALLBACK,
'page callback' => 'dash_feedbackid_callback',
'access callback' => 'user_is_logged_in',
'access arguments' => array('access content'),
);
return $menuitems;
}
并在javascript中执行以下命令:
jQuery.ajax({
type: 'POST',
url: '/mytest/feed/feedbackid/',
dataType: 'json',
success: function(data){
alert('ok')
},
// Might want to use 'ui' instead of jQuery('#slider').
data: 'slider_value=' + '1',
});
在控制台中我收到以下错误:
POST http://localhost//mytest/feed/feedbackid/ 404 (Not Found)
我重新安装了模块并清除了缓存
答案 0 :(得分:0)
拿第一个" /"从网址中删除...继续修复:
jQuery.ajax({
type: 'POST',
url: 'mytest/feed/feedbackid/',
dataType: 'json',
success: function(data){
alert('ok')
},
// Might want to use 'ui' instead of jQuery('#slider').
data: 'slider_value=' + '1',
});
发生在每个人身上......