Todayโs tutorial is ideally (designed) for the writers of blog posts who administer their blogโs content, and augments the content of NetBeans Java Web Application Primer Tutorial as shown below, to illustrate that within your WordPress (Blog) Posting you can include (dynamic) Javascript functionality. Today we do this with a WordPress (Blog) Posting that allows you to play a game of Noughts and Crosses (maybe you say Tic-Tac-Toe?!).
The advice Iโd give about this (and could well apply to other CMS products other than WordPress) is listed below in point form (the one in bold itallics is the โget to the pointโ point):
- If you are using a WYSIWYG (blog) post editor make sure you choose the HTML content option, to do with what follows.
- In your embedded Javascript make sure there is no white space between your <script type=โtext/javascriptโ> and what follows, and between your ending </script> and what follows, then place all this (Javascript) into the correct position of your (blog) posting HTML.
- Test that this does not interfere with other functionality โฆ reason for โis really for the writers of blog posts who administer their blogโs contentโ above.
- A good way to โtestโ (as in point above) is to unit test your Javascript on a local webserver (like MAMP on a Mac or EasyPHP on Windows etcetera etcetera etcetera), and then separately test it integrated in with your actual (blog) website as a separate test before publishing.
- You can get the gist of the nitty-gritty of todayโs tutorial by looking at your View Page Source option on this browser session โฆ Javascript of the (blog) posting starts at <script type=โtext/javascriptโ>var cgoes=โโ;
- You may ask, why are we talking about this? One reason is that lots of people would not want to touch, or are not permitted to touch (though that would be a bit weird for my (default) target audience?!), their (WordPress) theme code, and this method circumvents having to, but pretty obviously, wonโt make you that cup of coffee before you even knew you wanted one, first thing (however, if I am wrong, can we do an app together?!).
- Conversely, as a (blog) post administrator, you can see that perhaps if you have guest (blog) posting functionality maybe you should (within the WYSIWYG preferences) turn off the possibility of the use of <script> and </script> tags (ie. embedded Javascript).
| | | | | | | | | | | |
| | | | | | | | | | | |
V | V | V | V | V | V |
You say Tic Tac Toe โฆ I say Noughts and Crosses
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Previous NetBeans Java Web Application Primer Tutorial is relevant and shown below.
Todayโs NetBeans Java Web Application primer tutorial builds on our previous Tic Tac Toe game shown below. We need to revisit this area of NetBeans to examine web Java Servlets, at a later date, because this Tic Tac Toe Java Web Application only goes so far as to use a JavaServer Page using JavaScript but Ajax, for instance, can be part of such functionality. In saying that, take a look at the last two slides of the tutorial to see that you can mix Java with HTML when you use JSP functionality.
Programming IDEs take a lot of the hard work out of tasks such as compiling and linking in languages such as Java, C, C++, VB.Net and C#. In the case of NetBeans IDE, which this blog reintroduces to you today (its customary to shake hands, and no Klingon is necessary), it can create a Java Web Application, for instance, as we do today to create a Tic Tac Toe game as a web application. To cut a long story short, there aint nothinโ wrong with a good olโ IDE, but beware of IDEs in March.
In saying that about IDEs, and how they make programming easier, often with Open Source programming, it is advantageous to know what goes on โunder the hoodโ (or even โin the โhoodโ โฆ chortle, chortle). So if you ever get an opportunity to get helped creating your own makefile (or make it yourself, even with the Sweet Green Icing โฆ knew it could be worked in!) for something, take the opportunity to learn how to do this, as the Open Source world will become a little easier to navigate with such types of knowledge. Youโve got to admire those early designers of computer languages, and those days when all you had was this tiny bit of memory (64k or โinto the heliosphere on 8,000 bytes of memoryโ) to play with to create your program.
In doing this NetBeans Java Web Application found that Java JDK 1.6 needed to be upgraded to Java JDK 1.7 to allow for the workings of the GlassFish Web Server used by NetBeans, and, in order to do this, found How to upgrade JDK 1.6 to a higher version to run Glassfish? was incredibly helpful pointing to Java SE Downloads as the useful download area of interest.
NetBeans can be an IDE for much more than Java โฆ it can supervise PHP, C++, Maven, Groovy and HTML/Javascript. In coming days and weeks weโll look at more.
Link to downloadable NetBeans Java Web Application JavaServer Page programming source code at indexjsp
Link to NetBeans โspiritual homeโ download page at NetBeans.
Previous Tic Tac Toe game shown below.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Here is a great movie scene that springs to mind.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.