Address bar

Written by @kerixa 21 August 2012

The following code is a simple address bar. When you enter the address you want and click the go button, a new window like pop-up will open for you and your address will be loaded.  If you click on the button without entering any address, it will give you an alert that you must enter an address. You can change features such as the length and width of the pop-up window to your liking.

Code Snippet:

                                                
                                                <!-- this script is provided by www.javascriptfreecode.com coded by: Kerixa Inc. -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>body,table,input,select,textarea,div {font-family:tahoma;font-size:8pt}</style>
<!--</head>-->
<!--<body>-->
<form name="login">
<p dir="rtl" align="left">
<input type="text" name="js4ir" size="14">
<input type="button" value="Go" onClick="Login(this.form)">
<script language="JavaScript" link="www.js4ir.com">
function Login(form) {
var js4ir = form.js4ir.value;
if (js4ir) {
var site = "http://" + js4ir; window.location = site;}
else {alert("Please enter your adress");}}
</script>
<br><a target="_blank" href="http://www.javascriptfreecode.com">
<span style="text-decoration: none">eg:www.javascriptfreecode.com</span></a>
</p>
</form><a target='_blank' href='www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>                                                
                                            

Example:


About @kerixa

I am Krishna Eydat. I studied Software Engineering at University of Waterloo in Canada. I lead a few tech companies. I am passionate about the way we are connected. I would like to be part of something big or be the big deal!

K

Comments


Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Shahmeer, coolcoco7, SmitaPatil25, owoboycute, 092010
advertisement 2