I really did not want to be posting this, but here I am. It looks like I have been unable to find any way to simply display a java variable in an html doc. I have a feeling this isn't possible and I should be using javascript or something else but I would love it if someone could point me in the right direction.
My Java code is simple and basically just creates a single int that I would like to use in my html doc. For arguments sake let's imagine this:
JAVA CODE
public class Counter {
public static void main(String[] args) {
int number = 24;
}
}
Once again for argument sake
HTML CODE
<HEAD>
<script src="java/counter.java"></script>
</HEAD>
I've looked into things like document.write() and Element.innerHTML but I believe these things are probably associated with Javascript and/or JSP. I'm expecting more of an explanation rather than some simple code since I'm sure I'm going about this wrong. Just want to know how I should create my "counter", whether it be in Javascript or something else. I am using PHP and CSS so I also am also not sure if I should be using those to access my programs final int. First dive in to multi language programming so be gentle. Thanks!