Contents of My Nook on the Web
Home Page

JavaScript Documentation PDFs
(OBSOLETE


JavaScripter
  Help
  Change Log

Analog LOGFORMAT for MyDomain Sites

Replacement Tips For Radio Shack 64-2184 Soldering Station

How to to allow tabs to be used a <textarea>

Site Change Log

Email Me

About Me

The following are links to other sites. They will open in a new window or tab:

My Wife's Business Named Sew-lutions

Sugarcat Simon's Niche on the Web about Feline Diabetes

Online Etymological Dictionary

Web site tracking a "person" through thirty three companiess in 8 states

Bob Novell's Nook on the World Wide Web
Javascripter Help Page
Page Last Updated: July 4, 2011
Changed format to match other pages on this site.
Starting using a SSI for Navigation List
Validated HTML and CSS and added Icons


Javascripter is an HTML page and Javascript code which provides you with a way to create Javascript code which will dynamically write HTML statements into the body of a web page.

Why would you want to "dynamically write HTML statements into the body of a web page"?

Well, have you ever wished you could create an HTML file containing links to all of the pages on your web site and then have that file included in your web pages as users browse them? This would allow you to add, removed, or change pages without having to change the links on each of your web pages.

One way you could do this is with SSI (Server Side Includes), a feature in most servers which allows you to include files into web pages. The catch is that most ISP's have diabled SSI because of fears that it might be some sort of security issue.

There's nothing you can do to change that, but you can use Javascripter to get the same sort of functionality for your web page.

The best way to explain how to use Javascript is to show you an example:

Let's assume that you want the following links on  your pages - we are going to be working at the HTML level:

<a href="home.html">Home Page</a>
<a href="sitenews.html">Site News<a>
<a href="photos.html"><Photos</a>


Most web sites have more than three pages, but this is enough to show you how to use Javascripter.

You would normally have to code each of these statements in each of your pages and you'd have to change each page if you remove, add, or rename a page.

Using Javascripter, you can create Javascript code which you would save on your web site as a JS file.

Javscript files can be "included" into web pages using the HTML <SCRIPT> tag.

You do not need to know anything about Javascript to use Javascripter, but I'd like to explain what the output from Javscript looks like and what it does.

If you process the sample HTML given above with Javascripter, the output would look like this:

// Code generated by JavaScripter, Copyright (c) 2005, EvStar - at www.bobnovell.com/javascripter.html
document.writeln(unescape('%3Ca href="home.html"\>Home Page%3C/a\>'))
document.writeln(unescape('%3Ca href="sitenews.html"\>Site News%3Ca\>'))
document.writeln(unescape('%3Ca href="photos.html"\>%3CPhotos%3C/a\>'))
// End of code generated by Javascripter


The two lines which begin with // are Javascript comments which you must, as a condition of using Javascripter, copy "as is" and leave in the code generated by Javascripter. The comment lines will not show on your web pages. They are generatred to give me due credit for Javascripter.

The other lines are what do the job of inserting the HTML into your web pages. In short, document.writeln is a Javascript function which writes to the web page whatever is included between the opening and closing parenthesis. "unescape" is another Javascript function. Used here it will translate the "%3Ca" to a less than sign (<). I am doing this because I have found that in some instances problems are created if you directly code an HTML tag in a document.writeln. To prevent any problems, Javascripter converts any less than signs in your HTML to %3CA. When the document.writeln is executed, when your page is displayed by an Internet browser, the %3CA will be convert to <

The Javascript generated statements shown above will write the following to your web page:

<a href="home.html">Home Page</a>
<a href="sitenews.html">Site News<a>
<a href="photos.html"><Photos</a>

Which is exactly what we started this example with, right?

Okay, the code that Javascripter creates can write your HTML statement into each of your web pages, but how do you "include" the code in your pages?

Let's say that you have saved the output of Javascripter in a file name navigate.js in the same directory as your web pages.

To include the code in you web pages, you add the following line in the spot in the page where you want the HTML statements created.

<script language="javascript" type="javascript/text" src="navigate.js"></script>

Copy everything just as it as shown, except for
src="navigate.js" You will need to modify this part to point at the file in which you saved the output from Javascripter.

A <script> tag with a src= operand instructs the users internet browser to request the referenced JS file from the server and insert the JS file into the web page where the <script> tag is placed. The internet browser evaluates the Javascript code and, in our case, will write your HTML statements into the web page write at the point where the <script> tag was placed.

This allows  you to create one "Navigation" file and "include" it into all of your web pages.

To Use Javascripter, follow these steps:

1) Create the HTML you want to input to Javascripter. Javascripter does not syntax check anything you provide as input. It is completely your responsibility to make sure the HTML is correct and accomplishes what you want accomplished. Test the HTML before you input it to Javascripter. The best way is to put the HTML in one of your web pages and work on it until it works as you wish it to.

2) Copy the HTML to your system's clipboard and go the Javascripter Page and paste it into the top textbox, which is labeled "
Paste your HTML code into the box below and click the Generate Code Button"

3) Click the Generate Code button.

4) When the generated Javascript code will be displayed in the bottom textbox, copy it to the clipboard.

5) Open a  new text file, Windows users can use the NotePad program, which should be in the Program Menu under Accessories. Copy the output to the clipboard and then paste the generated code into the text file. Do not use any word processor or HTML editting program or other program which will add formatting or other things to the file. You want to save only the generated code in a file. After pasting the code into the file, save the file with whatever name you wish to use BUT  the extension must be js. Upload the file into the same directory/folder in which your web pages are stored.

You can upload the file into another directory/folder but you will need to add the directory name to the src= parameter on the <script> tag. Unless you understand the process of specifying directories/folders when making web pages, it is best to simply put the JS file in the same directory as your web pages.

Let's say your file name is navigate.js

You will need to insert this tag in your web pages at the exact place you want the HTML statements inserted:

<script lanuage="javascript" type="javascript/text" src="navigate"></script>

The best way to test your HTML before you use Javascripter is to put it in one of your web pages and test and change it until the page looks the way you want it.

Then copy out the HTML you want to include in each page and input it to Javascripter.

Javascripter will make document.writeln statements for each line you put into the input textbox. You can put anything you want in the textbox. It does not have to be HTML, it can be anything.

Whether it will accomplish something useful is up to you.

Support:

Javascripter is being made available for use with no user support. I simply don't have the time to assist with it's use. If, however, you find a bug in Javascripter, email me (look for the Email Bob link on the left, towards the top of this page) and I will look into it.

Copyright:

Javascripter is Copyright2005 by Bob Novell.

You are granted the right to use Javascripter but only by accessing it through the javascripter.html page on the www.bobnovell.com web site. You may freely use the output of Javascript provided you leave in place the to generated Javascript comments which will be placed one above and one below the generated code. These comment lines will read as:

// Code generated by JavaScripter, Copyright (c) 2005, EvStar - from www.bobnovell.com/javascripter.html
// End of code generated by Javascripter


These statements must be left intact in the generated code when you place it in any of your web pages or other files. I took the time to write Javascripter, test it, and document it and I have the legal right to what little credit these comment statements convy to me.

You may place a link to the Javascripter page on your web pages but you may not include Javascripter within any frames or other devices or methods which display the Javascripter page in such a way that the user could misconstrue that Javascripter is a part of your web site.

Valid HTML 4.01 Transitional

Valid CSS!