Sunday, January 13, 2019

Internal Javascripts

Internal Javascripts :   
The script code can be written directly into the HTML document. script code is placed in header of the document using script tag .

EXAMPLE: 

<html>

<head>

<title>Internal Script</title>

<script type="text/javascript">
function internal(){
alert("Internal Script");
}
</script>

</head>

<body>

<h2>Example for Internal script</h2>

<input type="button" 
onclick="internal();
"value="Click here" />

</body>

</html>

OUTPUT:-
sk.1

sk.2

External Javascripts

External Javascripts :         

If the functionality to be defined is used in various HTML documents then it's better to keep that functionality in a separate Javascript file and then include that file in your HTML documents. A Javascript file will have extension as .js and it will be included in HTML files using script tag.

EXAMPLE:

<html>

<head>

<title>External Script</title>

<script src="/html/External.js" 
type="text/javascript"/>

</script>

</head>

<body>
<h2>Example for External Script</h2>

<input type="button" 
onclick="External();
" value="Click here"  />

</body>

</html>

OUTPUT:-
sk.


HTML JAVASCRIPTS

HTML JAVASCRIPTS :   

A script is a small piece of program that can add interactivity to the website. For example, a script could generate a pop-up alert box message, or provide a dropdown menu. This script could be written using Javascript or VBScript , various small functions, called event handlers can be written using any of the scripting language and then you can trigger those functions using HTML attributes.
The <script> tag is used to define a clientside script, such as a JavaScript.

USING IFRAME AS TARGET AS LINK

USING IFRAME AS TARGET AS LINK :

An iframe can be used as the target frame for a link ,the target attribute of the link must refer to the name attribute of the iframe.

EXAMPLE:-

<html>

<body>

<iframe width="100%" height="300px"
src="d_iframe.htm" name="iframe_ex">
</iframe>

<a href="http://www.google.com
/demo12" target="iframe_ex">
IFRAME-TARGET</a>

<p>When the target of a link matches 
the name of an iframe, the link will 
open in the iframe.</p>

</body>

</html>


OUTPUT:-
sk.1
sk.2

IFRAME EDITING THE BORDER

IFRAME EDITING THE BORDER :

The border of the Iframe can be edited and changed according to the needs , By default, an iframe has a black border around it . The Iframe border size , color and style can be changed with css .

EXAMPLE:-

<html>

<body>

<iframe src="edit_exiframe.htm" 
style="border:4px outset red">
</iframe>

</body>

</html>

OUTPUT:-
sk.

IFRAME HEIGHT & WIDTH

IFRAME HEIGHT & WIDTH :  

Use the height and width attributes to specify the size of the IFRAMES ,the attribute values are specified in pixels by default, but they can also be in percent.

EXAMPLE:-


<html>

<body>

<iframe src="example_iframe.htm" 
width="200" height="200"></iframe>

</body>

</html>

OUTPUT:-   
sk.

Saturday, January 12, 2019

HTML IFRAMES

HTML IFRAMES :        

An IFrame (Inline Frame) is an HTML document embedded inside another HTML document on a website , which is displaying a web page within a web page. The IFrame HTML element is often used to insert content from another source ,it can be configured with its own scrollbar independent of the surrounding page's scrollbar.

Syntax :-    <iframe src="URL"></iframe>


      

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...