Monday, April 30, 2012

Interview Study Log

Thursday, April 19, 2012

Call Parent Window Function from Child Window

Parent HTML
function openChild() {
    window.open(url, "child", "width=800,height=180,left=0,top=150,location=0");
    // Syntax - window.open(URL,name,specs,replace)
    // DO NOT leave "name" parameter blank. In this case it is "child"
)

function parentMethod() {
    alert("Hello From Parent");
}

Child HTML

function  callParentMethod (customerKey, programKey) {
    window.opener.parentMethod ();
}


<input type="button" id="btn" onclick="callParentMethod()" value="Call Parent Method">


Labels: ,

Wednesday, April 11, 2012

Understanding Instance and Class Members (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

Understanding Instance and Class Members (The Java™ Tutorials > Learning the Java Language > Classes and Objects): "Not all combinations of instance and class variables and methods are allowed:

Instance methods can access instance variables and instance methods directly.
Instance methods can access class variables and class methods directly.
Class methods can access class variables and class methods directly.
Class methods cannot access instance variables or instance methods directly—they must use an object reference. Also, class methods cannot use the this keyword as there is no instance for this to refer to."

'via Blog this'

Thursday, April 5, 2012

Attach an action on "Enter" key press

document.onkeypress = onKeyPressAction;


function onKeyPressAction() {
        if (event.keyCode == 13) {
            search();
            return false;
        }
}

function search() {
    // do something
}

Labels:

Wednesday, April 4, 2012

Using BETWEEN in oracle dates

select *
from my_table
where trunc(record_insert_date) between to_date('02-Feb-2012', 'DD-MON-YYYY') and to_date('04-Apr-2012', 'DD-MON-YYYY')

Labels: ,