Forum Moderators: open
I cant be bothered to edit the actual PHP source... and it seems that using PHP in the templates does nothing, so I'm testing some javascript that can easily be used to do what I want. Only problem is that when run...nothing is document.written, so to speak.
I'm not good at Javascript at all, so can someone kindly tell me where I've gone wrong here?
<script type="text/javascript">
function harhar(name,posts) {
if(name == "Imleet") {return 1337;}
else {return posts;}
}
document.write("Posts: ");
document.write(harhar(test,30));
</script>
<noscript>
Posts: 30
</noscript>
Putting quotes (single or double) makes it work :)
<script type="text/javascript">function harhar(name,posts) {
if(name == "Imleet") {return 1337;}
else {return posts;}}
document.write("Posts: ");
document.write(harhar('test',30));</script>