I'm developing my website right now, the website will have an API made with Javascript and jQuery. In a game named ROBLOX I'm trying to get the player's username just via his ID. The only problem is that the username label has no ID, so I get the username label via the class.
However when I call innerHTML
, innerText
or call the .text()
method, it doesn't return me anything, however there IS text in there. Is there another way to get the text inside the object? It's basically The class > h1 > text
. I'm not sure if I'm using the wrong methods. Could someone help?
function My(){
var user_id = 97423773
var lawl = ""
$.get("roblox.com/users/" + user_id + "/profile", function(data, success) {
lawl = $(".profile-about-content-text", data).text()
alert(lawl)
});
return lawl
}
My()