9 Sep
I’ve been using wp-hascash for a while not and it was a bit of a pain in the ass to setup at first. There’s making sure you have the wp_head called before the closing </head> tag and comment_form called before the closing </form> tag in comments. But I started running into another error that was visibly manifesting itself as my other scripts on the page failing to fire and thus some visuals all out of whack.
After digging around a bit in the debugger and google I found this little bit of info that has fixed every issue I’ve had with wp-hashcash in the last few version of WordPress and wp-hashcash.
Error: document.getElementById(”wphc_value”) is null
so as to avoid this, it’d better to check beforehand if it’s null. So to say:
change line 372 from
echo “addLoadEvent(function(){document.getElementById(’wphc_value’).el.value=wphc();});\n”;to:
echo “addLoadEvent(function(){var notNullWphc= document.getElementById(’wphc_value’); if(notNullWphc){notNullWphc.value=wphc();}});\n”;
Hopefully this will help folks out there suffering form the same “WTF?!” situation.
P.S. wp-hashcash works very well.
Leave a reply