Tag Archives: Postaday2011

Drupal – Load External Javascript using drupal_add_js() @ 2

Here is another way to add the external .js file.

$external_js = 'http://www.example.com/a.js';
drupal_add_js('document.write(unescape("%3Cscript src=\''. $external_js . '\' type=\'text/javascript\'%3E%3C/script%3E"));', 'inline');

 

Done =)

Previous Post: Drupal – Load External Javascript using drupal_add_js() @ 1

Reference: Web Design by Tim Wooten – Load external js file in Drupal 6

陶傑 – 心光英雄

Ahmed Harara
The famous photo of Harara by Hossam Hamalawy

雖然經過革命,但一個民族,經暴政獨裁長期強姦,心理扭曲,基因變異,即使模仿西方白人的「民主」,也要經歷很長的血腥陣痛。

有的國家,陣痛一陣子,像二百年前的法國,從帝制走出來,建立共和,恐怖時代,為期兩年,二百年來雖有短暫的復辟,民主、自由、人權,還有品味和享受,一路順風順水。 Continue reading 陶傑 – 心光英雄

Drupal – Load External Javascript using drupal_add_js() @ 1

If you want to include external .js file in your custom module, create the following file.
external.js

(function ($) {
  Drupal.behaviors.myModule = function(context) {
    var externalScript = $('<script></script>').attr('type','text/javascript').attr('src', 'http://example.org/example.js');
    $('body').append(externalScript);
  }
}(jQuery));

Continue reading Drupal – Load External Javascript using drupal_add_js() @ 1

Drupal – Get the Number of nodes under a Parent Term

Previously, we talked about how to get the number of nodes of a specific term.
Drupal – Get Number of node of Taxonomy Term by Term ID

How about if i want to get the number of nodes under a specific parent term? Unfortunately, there is no such function. so i try to get that number by SQL. Here is the PHP code.
Continue reading Drupal – Get the Number of nodes under a Parent Term

What I Wish I Knew When I Was 20

作者: Tina Seelig

What i wish i knew when i was 20 … ? It’s never to late to know.

作者 Tina SeeligStandford University 任教,一個 Neuroscience Ph.D. 但教 Entrepreneurship and Innovation,這樣的一個 Career path 若果係香港發生應該係一個奇積。

如果你已經有一生清晰的方向,一份”穩定”的工作,一個你認同的社會文化,而你好享受那種生活,請不要看此書,這書不適合你。

這書真的給了我很大的鼓勵,讓我更肯定自己現在走的路正是我想要的,希望一年後我再看此 post 後已經有些少成績。