Wednesday, August 11, 2010

Injecting Own .js to the Mac OSX Wiki

Following the issue on this discussion, I just figured out how to inject .JS to the Mac OS X wiki engine so the javascript will be executed on every wiki page, its a pain in the as* knowing that the Chapter 3 in the Wiki Server Administration 10.6 manual, didnt tell anything about this. This guide expected us to use the prototype.js framework, but the hell with it, i just loved the old .JS :d

Ok, this is how you handle this kind of issue. To get the script files executed at least you need to load the script by adding "if(window.loaded)loaded('yourjavascriptfilenames.js');" at the bottom of your scripts.

e.g 
----- lowlifes.js ---
function lowlifes(){
function suckBlood(){
return true
}
Bla bla bla bla
}
if(window.loaded)loaded('lowlifes.js');
------ EOF ---

It works for me  and Enjoy

No comments:

Post a Comment