Basically the program counts through unicode characters by using a set timeout feature similar to what you would use for a clock.
The only problem is that many of the entries are blank so I wanted to write a series of if statemtns that would eliminate the blank spaces based on analysis. For example the counter does nothing till the 12th increment then it shows a symbol. I am trying to make some code to eliminate the blanks but I cant figure out what to do. I commented where I am having trouble.
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <script type="text/javascript">
- var c=0;
- var t;
- function timedCount()
- {
- String.fromCharCode(c)
- document.getElementById('txt').value=String.fromCharCode(c);
- document.getElementById('text').value=c;
- //This is the problem area every time I try if statements it doesnt work.
- c = c+1;
- d=(d+1);
- e=(e+1);
- t=setTimeout("timedCount()",1000);
- }
- function stopCount()
- {
- clearTimeout(t);
- }
- function resetC()
- {
- c=10;
- reset();
- }
- </script>
- <style type="text/css">
- .style1 {
- font-family: ;
- font-size: 60px;
- color: rgb(0,100,175);
- background-color: #FFFFCC;
- padding: 2px;
- height: 80px;
- width: 100px;
- border: 1px solid #7F9DB9;
- }
- .style2 {
- font-family: ;
- font-size: 60px;
- color: rgb(0,100,175);
- background-color: #FFFFCC;
- padding: 2px;
- height: 80px;
- width: 300px;
- border: 1px solid #7F9DB9;
- }
- </style>
- </head>
- <body>
- For God (the Primary Maker of the Good Place Beyond this life)
- <br></br>
- <form>
- <input type="button" value="Start Count" onClick="timedCount()">
- <input type="text" class="style1" id='txt'><br></br>
- <input type="button" value="Stop count!" onClick="stopCount()">
- <input type="button" value="reset" onClick="resetC()">
- <input type="text" class="style2" id='text'>
- </form>
- <br></br>
- <br></br>
- <br></br>
- <p>Click on the button above. The the imput will start counting throgh various unicode characters.</p>
- </body>
- </html>