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: ,

Friday, December 9, 2011

Editable DIV

CSS
        div.editableContent {
            width: 390px;
            height: 561px;
            border: 1px solid #ccc;
            background-color: white;
        }
HTML
    
Useful Attribute
    mailSubject.contentEditable = true;
    mailContent.contentEditable = true;

Labels: , ,

Thursday, November 17, 2011

The following example shows how to use the contentEditable property to control whether the user can edit the content of the object.



Click the button to enable or disable SPAN content editing.

You can edit this text.
SPAN can be edited:
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/contentEditableEX2.htm This example demonstrates the features of Internet Explorer that enable users to edit the content of an HTML element directly from the browser. Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/editRegions.htm
Ref.: CONTENTEDITABLE Attribute | contentEditable Property

Labels: ,