Tuesday 17 April 2012

IFRAME Example


The <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.

I wanted to have the "src" to be changed dynamically. 

Here is the example of IFRAME where in source can be changed though TextField. 
Whatever you enter into the text box will be given to the Iframe and iframe window will render that page.


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TEST Page</title>
</head>
<script type="text/javascript" >
function iframeMethod() {
var srcValue =  document.getElementById("text");
var iframe   =  document.getElementById("frame");
iframe.setAttribute('src', srcValue.value);
}
</script>
<body>
<iframe src="http://www.google.com" name="frame" id="frame"
frameborder=0 style="overflow:visible; width:100%; height:600; scrolling="no">
</iframe>
<input type="text" name="text" id="text" target="frame"/>
<input type="submit" name="submit" id="submit" value="Submit" onclick="javascript:iframeMethod();"/>
</body>
</html>

Monday 9 April 2012

How to set JAVA_HOME environment variable in Ubuntu


    Open /etc/bash.bashrc using sudo command
    e.g. sudo gedit /etc/bash.bashrc.
   
   go to the end of the file and add following lines:

    JAVA_HOME=/usr/lib/jvm/name_of_your_java_folder(e.g. java,open-6-jdk etc.)
    export JAVA_HOME
   
    PATH=$PATH:$JAVA_HOME/bin
    export PATH

   Done. Just reboot your computer.


    echo $JAVA_HOME
    it shows something like this:/usr/lib/jvm/name_of_your_java_folder(e.g. java,open-6-jdk etc.)
 
    echo $PATH
    it shows something like this::/usr/lib/jvm/name_of_your_java_folder(e.g. java,open-6-jdk etc.)/bin