I'm trying to grab an username on a MyBB forum, by sending a .get() to the page I hover, then get the username, make it into a variable, and make the hover tooltip show the username.
$('a[href*="forum.net/member.php?action=profile&uid="]').each(function(){
$.get(this, function(data){
var username = $(".largetext").text();
});
$(this).qtip({
content: username,
show: 'mouseover',
hide: 'mouseout'
});
});
.qtip() is a plugin I use to make the tooltip popup. It works perfectly, but not when I try this code. $(".largetext").text(); is used to grab the username, once the URL has been loaded.
Anyone know where I'm going wrong? That code will give me an username undefined error, but I tried just to define it to be 0 before the .get() but it'll just be 0 then.
Thanks in advance