Opening and Editing .js Files

Editing Javascript .js files in Allwebco templates

Pinned Note .js Files
All Allwebco templates use .js files. These files contain Javascript code used in the template pages. They globally add scripts to all webpages and may be used to "write" items to the pages. Example: The menu.js "writes" the menu on all the HTML webpages globally.

See Also…

Editing .js files
.js files are plain text and can be edited using Notepad, TextEdit, or any plain text editor. Some HTML editing software can also edit .js files. You should make a backup of the first .js file you edit and test your editor with a save to see that it will work with .js files.


Editing .js file variables
Open your "sidebar.js", "header.js" or other .js file in a plain text editor like Notepad. Click on the visual below to see what areas to edit (See also: editing .js file variables).

View JS File Editing

Note: You may want to make a backup copy of the .js files before you start editing. In all .js files the yes/no options should be all lower case.


Javascript hidden email code
Your template may include a script protected email link. This type of script helps hide the email from spam harvesting if the email link is placed directly into an HTML page. In Allwebco templates this script is used in the sidebar area, and only if the template does not include a "contact.js" or "phone.js". See your template help.html to see if you have this type of code. Click the visual below.

View Hidden Email


Troubleshooting:

Error opening .js files
When you double click the .js file and get some type of error or it will open in the wrong application. This means that the .js files are associated with another application. Here are three options to open and edit .js files in Notepad, TextEdit or a plain text editor.

Solutions:
  1. Open Notepad or TextEdit, open the template folder, then drag the .js file into Notepad or TextEdit and drop it.
  2. Open Notepad or TextEdit, select "file" then "open", browse to the template folder, select "all file types" and open the .js file that way.
  3. Windows Only: You can change the file associations so when you double click a .js file it will open in Notepad: Open "My computer" choose "tools" or "options" then choose "folder options" choose the "file types" tab. Find "JS" on the list and change the opening application to use Notepad.exe in the Windows folder. Changing this association should cause no problems on your computer.
  4. Mac Only: You will change the application in which a .js document opens. In Finder, select the .js file, like "menu.js", the choose "File" > "Get Info". In the Info window, click the disclosure triangle next to "Open With", and select the TextEdit application to open the document from the "Open With" pop-up menu. If you want all .js documents to open with the same application, click "Change All".
  5. See also: editing .js files in windows




Related Topics:
Choosing Software
Editing the Menu