Tiptip and ajax

jerome's Avatar

jerome

03 Jun, 2013 02:19 PM

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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

08 Feb, 2017 08:05 AM
08 Feb, 2017 08:02 AM
08 Feb, 2017 07:56 AM
08 Feb, 2017 07:53 AM
08 Feb, 2017 07:45 AM