FJS.js What is FJS
FJS is an object which let you easily bookmark your javascript
code by automatically generate a link for that script. After generating
the link, you can bookmark this link and use it in any page you browse.
It has been tested over Firefox 1.07, IE 6 and Opera 8.51.
FJS works on all of them.
How to use it
For generating code from a string :
FJS.Linstall(name, string);
/* Example: */
FJS.Linstall("example", "alert('hi');");
For generating remotely link to a file :
FJS.Rinclude(name, string);
/* Example: */
FJS.Rinclude("example", "alert('hi');");
For generating code from a file:
FJS.Rinstall(name, filename);
/* Example: */
FJS.Rinstall("example", "js/example.js", callback);
Linstall and Rinclude return the anchor element generated. When using Rinstall, callback function is needed as the third parameter to receive the generated anchor element. This anchor element will also be automatically append at the end of the document when FJS.write is set to be 1(default is 0).
This anchor element has css class named '
.FJSinstaller',
thus you can modify its appearance by applying custom css rule in your
css sections or files.
FJS uses
http.js. You have to include http.js before FSJ.js.
Usage
You can use FJS to install language translator, DOM inspector,
javascript variable inspector or flash-remover on your
bookmark bar. Just call the FJS functions, open your web page,
and bookmark the generated link.
The context of the installed javascript is just the
context of current viewed page.
Example
If you have enabled javascript and you are using one of the browser
listed above, You should have seen a link named 'example' below.
Click it and you will get a message box says 'Example'.
This is just what example.js will do.
You can check
example.js for details.
Another link named 'Table of Content' generate a table of content
in the up-right corner. Corresponding script can be found
here : content.js.
As noticed before,the generated link has class FJSinstaller. Thus,
you can change the appearance of this link by applying a
".FJSinstaller" rule in your css file.