我想通过ajax显示qtip弹出窗口没有成功。我得到了下面的代码,但似乎无法检测到哪里会出错。帮助将不胜感激。QTip2 ajax弹出不起作用
<script type="text/javascript">
$(document).ready(function()
{
$('.tiplink').qtip({
content:{
var id = $(this).attr('rel');
text: '<img class="" src="../images/loader.gif" alt="Loading..." />',
ajax:{
url: 'pops.php',
type: 'POST',
loading: false,
data: 'id=' + id
}
},
show: 'mouseover', // Show it on mouseover
hide: {
delay: 200,
fixed: true // We'll let the user interact with it
},
style: {
classes: 'ui-tooltip-light ui-tooltip-shadow',
width: 290
}
});
});
</script>
<a href="#" class="tiplink" rel='1'>show me the popup1!</a>
<a href="#" class="tiplink" rel='2'>show me the popup2!</a>
<a href="#" class="tiplink" rel='3'>show me the popup3!</a>
仔细观察,如果我放在qtip初始化这样前ID VAR的分配: VAR ID = $(本).attr( '相对'); $('。tiplink')。qtip({ content:{... 所有工作正常。这里有什么缺失或错误? – nixxx 2012-08-15 11:56:26
上面的问题是ID变量总是未定义。 var做ajax db查询.. – nixxx 2012-08-15 12:12:39