this keyword in javascript

August 30, 2010

This page neatly explains about “this” keyword

From javascript object oriented programming concepts –

The this keyword inside a constructor function refers to the object that’s being created.

Quoting below example from

function myFunc(StringValue){  <br>
this.StringValue = StringValue;  <br>
}  <br>
var myObject = new myFunc("This is myObject's string");  <br>
var myObject2 = new myFunc("This is a String");  <br>
alert(myObject.StringValue); // displays "This is myObject's string"  <br>
alert(myObject2.StringValue); // displays "This is a String"

Apache mod_rewrite NE|noescape

August 27, 2010

I faced an issue where the URL for example /saved/ was getting rewritten to %2Fsaved%2F, which caused the web application to give 404 error because it expects the URL without escaped/encoded characters.

I found this Stack Overflow thread related to this problem which gave the solution,

Add NE flag to prevent escaping –

Setting up an SSH tunnel with PuTTY

August 23, 2010

Setting up an SSH tunnel with PuTTY

This is useful when the server has firewall blocking access of the port from your network.

Browser Cross Domain Communication

August 18, 2010

While building Mashup or building Portals this may be a common development problem. There are 2 ways to solve this
1) Through JSON
2) Through iframe hack – — This uses YUI

JQuery plugin for the solution number 2 –

HTML5 supports this through postMessage – see Ajaxian post here –

Sun rises in the east

August 4, 2010

Recently I read a slashdot article – about Java 1.6.0_21 release crashing Eclipse IDE because the IDE has code which checks for “Sun Microsystems” in the JVM company field property. This made me think about whether we should write code to handle these rare scenarios or things we take for granted that they will not change. In my opinion if we know or can predict that something like this will happen then handle it in code, else deal with it when it comes.