View Single Post
Old 09-24-2016, 01:05 AM   #8
Alec Ford
Junior Member
Alec Ford began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2013
Device: none
Quote:
Originally Posted by kovidgoyal View Post
You have to put the other properties in quotes, like this

"_TITLE_"

because they are strings, not numbers.
Ah - that explains it, I haven't the mindset for JavaScript and when you need quotes or not.

So this is what I ended up with, maybe there's a better way. It puts page headers alternating between author and title starting at page 3

Code:
<p id="pagehead" style="text-align:center; font-size:x-large"></p><script>if ("_PAGENUM_" >2 ) {if ("_PAGENUM_" % 2 === 0) {document.getElementById("pagehead").innerHTML = "_AUTHOR_" }else {document.getElementById("pagehead").innerHTML = "_TITLE_"}}</script><p
Alec Ford is offline   Reply With Quote