Wednesday, March 31, 2004

Example to call a modal dialog from IE and pass values to it and get the return value

-----the caller code starts


<HTML>


<HEAD/>


 <BODY>


<SCRIPT LANGUAGE=javascript>


<!--


var mystr="hello";


mystr=window.showModalDialog("file://C:/Documents and
Settings/bhagyesh/Desktop/appa.html",mystr);


alert(mystr);


 //-->


</SCRIPT>


 </BODY>


</HTML>


-----the caller code ends


----the dialog code starts


<html>


<head/>


<body>


<script>


document.write(window.dialogArguments);


window.returnValue="bbbbb";


</script>


</body>


</html>


----the dialog code ends


function trim(s) {
while (s.substring(0,1) == ' ') {
s = s.substring(1,s.length);
}
while (s.substring(s.length-1,s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}

Friday, March 19, 2004

Origami