Get username in javascript
-
I have a javscript the function of it is to search for text.
But instead of text i would like to it to search for logged in users username.Can someone help me out?
<script> var match = '<GET_LOGGED_USERNAME>', firstSibling = null, secondSibling = null; window.onload = function(){ var selector = document.querySelectorAll('td'); for (i = 0; i < selector.length; ++i){ if(selector[i].innerHTML == match){ firstSibling = selector[i+1]; break; } } document.write(firstSibling.innerHTML); } </script>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get username in javascript’ is closed to new replies.