I want to pass a dynamic parameter with qTip, but it fails. my_ajax_controller.php just displays the variable type, but not q.
$('a.menu_help').qtip({
content: {
url:'my_ajax_controller.php',
data: 'type=help_menu&q='+$(this).attr('id'),
method: 'get'
},
show: 'mouseover',
hide: 'mouseout'
});
However, a static value of q works:
$('a.menu_help').qtip({
content: {
url:'my_ajax_controller.php',
data: 'type=help_menu&q=toto',
method: 'get'
},
show: 'mouseover',
hide: 'mouseout'
});
Is there no way to pass a dynamic value to the parameter data ?
Thanks in advance !
Florent
It should work, but just try to see what you pass as ID, or pass data as collection something like:
data : {'type':'help_menu', 'q':id}Or
$('a.menu_help').qtip({ var id = $(this).attr('id'); alert(id); content: { url:'my_ajax_controller.php', data: 'type=help_menu&q='+ id, method: 'get' }, show: 'mouseover', hide: 'mouseout' });