Published by Pui-chor on 08 Sep 2016

Priscilla Remembered

Priscilla Remembered
Memorial for Priscilla: DEDICATED TO MY BELOVED WIFE – PRISCILLA

NOTHING IS MORE IMPORTANT THAN A PERSON, TREASURE YOUR RELATIONSHIP THAN YOUR THOUGHT.

Published by Pui-chor on 24 Mar 2016

The latest version of firefox

Got frustrated with the latest version of firefox, version 40. This is getting worst. The bug found is that the line numbers are off, incorrect when using the inspector. The inspector is very important tool to debug and modify the style and script of a webpage. Then the inspector tells me that the style of the span element is in line 20 and the actual line number of the element is actually 340. Good grief. The offset is different for different webpage. Do not know how firefox screwed up the line numbers. The line numbers works in Chrome and Opera. I will switch the browser and goodbye firefox if you are not fixing the bug.

Published by Pui-chor on 10 Jan 2016

include other javascript files

Using plain javascript to add other javascript file, you do this:

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

and then in this master.js file you code this:

function include(file){
  var script  = document.createElement('script');
  script.src  = file;
  script.type = 'text/javascript';
  script.defer = true;
  document.getElementsByTagName('head').item(0).appendChild(script);
}

/* include any js files here */
include('js/myFile1.js');
include('js/myFile2.js');

Using jquery to add other javascript file, you do this:

$.getScript("/otherjavascript.js", function(){
   //alert("Script loaded but not necessarily executed.");
});

« Prev - Next »