Hello,
I have this jQuery code
I've tried testing JS with alert command, and the code runs, but it simply doesn't manipulate the content of the "#underNav".
I have this jQuery code
- Code:
$(document).ready(function(){
var path = location.pathname;
var links_members = `<ul class="linklist">
<li><a href="/memberlist?mode=posts&order=DESC&submit=Ok&tt=1&username">Most Messages</a> • </li>
<li><a href="/memberlist?mode=lastvisit&order=DESC&submit=Ok&tt=1&username">Last Visited</a> • </li>
<li><a href="/memberlist?mode=username&order&submit=Ok&tt=1&username">Members by name</a> • </li>
<li><a href="/memberlist?mode=groups&order&submit=Ok&username">Member in usergroups</a></li>
</ul>`;
if(path.indexOf("/u") >= 0 || path == "/privmsg" || path == "/profile" || path == "/" || path == "/groups" || path == "/register" || path == "/login"){
$("#underNav").html("");
} else if (path == "/memberlist"){
$(".user-relative-forum-statistics").html(links_members);
}
});
- Code:
//Variables
var path = location.pathname;
var x = document.getElementById("underNav");
var links_members = '<ul class="linklist"><li><a href="/memberlist?mode=posts&order=DESC&submit=Ok&tt=1&username">Most Messages</a> • </li><li><a href="/memberlist?mode=lastvisit&order=DESC&submit=Ok&tt=1&username">Last Visited</a> • </li><li><a href="/memberlist?mode=username&order&submit=Ok&tt=1&username">Members by name</a> • </li><li><a href="/memberlist?mode=groups&order&submit=Ok&username">Member in usergroups</a></li></ul>';
//Function
if (path.indexOf("/u") >= 0 || path == "/privmsg" || path == "/profile" || path == "/" || path == "/groups" || path == "/register" || path == "/login"){
x.innerHTML = "";
}
else if (path == "/memberlist"){
x.innerHTML = links_members;
}
I've tried testing JS with alert command, and the code runs, but it simply doesn't manipulate the content of the "#underNav".
Last edited by BloodDrunk on May 2nd 2017, 7:33 pm; edited 1 time in total