Tiptip and ajax
Hello
i would load content of tiptip from ajax but this doesn't work :-/
This is the code :
<div class="maclasse"><a href="#" ajaxparam="param1" title="">aaaa</a></div>
<div class="maclasse"><a href="#" ajaxparam="param2" title="">bbbb</a></div>
<div class="maclasse"><a href="#" ajaxparam="param3" title="">cccc</a></div>
<script>
$(function() {
$(".maclasse a").tipTip({ delay : 200,
maxWidth : "350px",
content: function (e) {
$.ajax({
url: "../front/toto.php?" + $(this).attr('ajaxparam'),
cache: false,
success: function (response) {
e.content.html(response);
//$("#tiptip_content").html(response);
}
});
return 'Chargement...';
}
});
});
</script>
2 errors insolved from my script :
- the url called by ajax would be "front/toto.php?param1" but it is "front/toto.php?undefined"
- in case of ajax success, the error "e.content is undefined" is catch. To resolve the problem, i do the comment line.
If someone knows the issue, i would be very very happy :-)
Sorry for my poor english and thanks for your help.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac