How to include the JavaScript in your own template?

One of the initial requirements for our Chess Game Viewer was that it shouldn't depend on another site. Of course it is possible to host the JavaScript on your own site and a site like Google sites will be sufficient. However the intention of the original requirement was also that it should be possible to host the needed JavaScript on Blogspot.
It is rather easy to accomplish this.
I assume that you already have configured your site to use the FEN viewer and the Chess Game viewer. Then look for the line in your template that refers to the external JavaScript file.

Let's start by downloading the JavaScript file from this site. After downloading open the downloaded file with Wordpad and copy the following lines at the top of this file.

<script type='text/javascript'>
//<![CDATA[

Next we are going to add the following lines at the end of this file.
//]]>
</script>

And by now we only have to replace the following line in your blogspot theme by the content in our Wordpad editor.
<script src='http://sites.google.com/site/viewchessgame/js/gv.js'
type='text/javascript'/>

Before actually changing your template it will be a good idea to backup your full template.

So now you know what to do to include the necessary code within your template. I only advice you to wait a little longer or to replace the code with the new code in the future, because the Chess Game Viewer is still under development and improving all the time.

  • I didn't understand this explanation at all
    You show these lines we're supposed to add but i don't see them within the downloaded text so i copy-pasted them from this page and then you say:

    "And by now we only have to replace the following line in our blogspot theme by the content in our Wordpad editor.
    script src='http://sites.google.com/site/viewchessgame/js/gv.js'
    type='text/javascript'/"

    I have no idea what you're talking about, sorry.

    Change what? from what? where? how do i find it?
    and even when the code is there.. how do i use it?

    maybe you can create a numbered steps explanation and include images

  • Do you already have configured your site to use the FEN viewer and the Chess Game viewer, because this post is only about the step to get rid of the external JavaScript and move everything to your Blogger template.

    The mentioned line can be found in your Blogger template. You have just entered it there yourself during the configuration of the FEN viewer. Now the line will be replaced by the JavaScript itself.