Editing Website Template .js Files
Adding New Items to a .js File
You can add new items to .js files. Generally you may want to add a new item to the menu.js, header.js, sidebar.js or copyright.js. You will want to add these items using Notepad in Windows or TextEdit on Mac.
To add any item to a .js file like the sidebar.js put the following in front of every line:
Put this at the end of every line:
Do one line at a time and test to see if the template pages are still working properly before you go to the next line.
NOTE: If you use a ' inside that code anywhere add a slash before it like this \'
Adding some text:
Perhaps you would like to add some text to the menu.js or header.js. You would add that like the following:
Just a short note<br>
NOTE: This will not work in the menu.js on any drop menu template. Use a " instead of a ' in that case for the above code.
Adding an Image:
Perhaps you would like to add an image with a link to the header.js. You would add that like the following:
<a href="newpage.htm"><img src="picts/yourimage.jpg" border="0"></a><br>
In the above example notice how this code is breaking into two lines. In the HTML pages make sure this is all on one line. If you need to, turn off "word wrap" under "Format" in Notepad or your text editor.
And remove this code...
Adding Google Ads or other items with .js file calls:
Some code or ads you will want to add may include other .js code. In other words you will be adding a .js file inside a .js file. Below is an example of how to add a .js file call inside a .js file.
If your line looks like the following:
One option would be to edit the above line by adding ' + ' in the script text and a \ in front of every / like the following:
The above is a complex edit. You will want to take care and be sure to do this edit carefully. Any single error and this may not work. Also see the Adding Google ads to a template support page.
EXAMPLE: Add a Google search box:
Perhaps you would like to add a Google search to the sidebar.js that looks like this:
You would want to copy the following code and paste this into your .js file:
In the above example you can also add this item to your .js file and then place this item anywhere on the page you would like. See Using a DIV to Place an Item.
Editing .js Files in Windows
Using a DIV to Place an Item