Search This Blog

Javascript inheritance: A simple example

var Person = function(name) {
    this.name = name;
}

Person.prototype.walk = function() {
    alert(this.name + ' is walking.');
}

var Driver = function(name) {
    Person.call(this,name);
}

Driver.prototype = Object.create(Person.prototype);

Driver.constructor = Driver;

Driver.prototype.drive = function(){
    alert(this.name + ' is driving.');
}

var dave = new Person('David');
dave.walk();

var john = new Driver('John');
john.drive();

Embed Youtube Video in a doku wiki page

Use the syntax below:
{{http://www.youtube.com/v/VIDEO_ID?.swf?640×360}}
where you need to replace VIDEO_ID with your actual video id, and 640x360 to the width x height you want.

Firefox: Disable mixed content blocking

Firefox blocks the mixed content by default. You can click the little shield icon at the left end of the address bar, then select "Disable protection...", to unblock the web site. However, Firefox does not remember it. Next time you open the web site, you need to go through the same process to unblock it. It is pretty annoying.

You can disable mixed content blocking by
  • Option 1: editing about:config
    • enter about:config in address field.
    • search for security.mixed
    • select security.mixed_content.block_active_content and set it false
  • Option 2: install Toggle Mixed Active Content addon
    • After install the addon, you will see a button with green capital A as icon. Color green means the blocking is enabled. Toggle the button to disable the blocking (the color of the icon will become red: means blocking is disabled.)

Note:

The above options disabled mixed content blocking on all the web sites. It downgrades the security a little bit. The ideal solution will be a whitelist of sites with mixed content in FireFox. We can vote for whitelisting mix-content sites function in Firefox.