0
I want that when the user logs in to my page, javascript checks his profile on the system and if the profile is empty, it directs to the home page.
It’s simple, I’m trying this code here, but it’s not working right:
<script>
var perfil = document.querySelector('#perfil').textContent;
if (perfil = ''){
window.location = "../index.php";
}
</script>
That’s all I need to do, if profile gets empty, then go to the index, only it’s not working that way there, how can I do?
My html
Could post the html?
– LeAndrade
html? html is just a p tag with id profile. I don’t really see the need to post. but it’s like this. <p id="profile"></p>
– Francis Vagner da Luz