Hey there! Love nodebb and the awesome potential of using it as my forum solution.
However, I have been noticing something odd? Whenever I try to click on a hyperlink, sometimes it appears the link doesn't work. It's not broken and doesn't lead to a 404. Rather, I click it and it does the same behavior if I clicked a link that was linked to an empty anchor of some kind. eg:
<a href="#">A link</a>
Wish I could show this behavior; it's difficult to describe. The link works if I right-click it and open it in a new tab or window. It's happened in the past while perusing this forum and it happened just now again when I tried to click on "Google analytics code not installed" in the unread list of topics.
My specs: Google Chrome Version 39.0.2171.65 m on Windows 8.1
EDIT: The same topic is back in my unread list/page and the same behavior is happening. Trying to click it but the link is 'lame' and won't work. Only right-clicking and opening in a new tab allows me to access it.
@frissdiegurke when using document.write you can avoid replacing the whole site, but it cannot be loaded asynchronously aka injected (as it needs to execute immediately on DOM build), which is most likely the case on most NodeBB pages
@DennisSun if you want to have a dynamic the protocol, or maybe that string at the end, use something like
var something = '0da233db09b6a0886cd3f9d1a52e64d8'; // or could be dynamically generated, I don't know
// build your script tag
var script = document.createElement('script');
script.async = true;
script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'hm.baidu.com/h.js?' + something;
// google analytics does that, this will find this actually script (unless loaded asynchronously, in that case it would find the last script tag on the page)
// it should work in either case
// var thisScriptTag = document.getElementsByTagName('script');
// thisScriptTag.parentNode.insertBefore(script, s);
// or you can just append it to the head
var head = document.getElementsByTagName('head');