How do I enter a URL?
I can't figure out how to make it so that, for example, the inscription is displayed: ENTER YOUR URL. For example, enter http://XXXX.xx, click on the ENTER button and this site at this URL opens in this page in a new frame?
1
Author: Nicolas Chabanovsky, 2011-01-08
4 answers
You can still do this:
<html>
<head>
<script language="javascript" type="text/javascript">
function goUrl(){
var url=document.forms.myForm.elements.usUrl.value;
window.location = url;
}
</script>
</head>
<body>
<form name="myForm">
<input type="text" name="usUrl" value="http://">
<button name="go" onClick="goUrl()">Перейти</button>
</form>
</body>
</html>
1
Author: Leshij_2005, 2011-01-09 09:46:28
<html>
<head>
<script language="javascript" type="text/javascript">
function goUrl(){
var url=document.forms.myForm.elements.usUrl.value;
window.location = url;
}
</script>
</head>
<body>
<form name="myForm">
<input type="text" name="usUrl" value="http://">
//<button name="go" onClick="goUrl()">Перейти</button> когда это меняю на это, то все работает <input type="button" name="go" onClick="goUrl()">
</form>
</body>
</html>
My script :
<html>
<head>
<script type="text/javascript">
function newLocation()
{
var ur=document.getElementById('usUrl');
window.location.href= ur.value;
}
</script>
</head>
<body>
<form>
<input type="text" id="usUrl" value="http://"/>
<input type = "button" value ="Перейти"onClick="newLocation()"/>
</form>
</body>
</html>
Example: link text
1
Author: kvaxminsk, 2011-01-10 22:24:53
In the frame-here:
<input type="text" id="from_here" value="http://hashcode.ru/" /> <input type="button" value="go!" onclick="return openUrlInFrame();"><br />
<iframe id="go_here"></iframe>
<script type="text/javascript">
function openUrlInFrame() {
document.getElementById('go_here').src=document.getElementById('from_here').value;
return false;
}
</script>
I think you know how to write styles for a frame)
1
Author: Sh4dow, 2011-02-03 09:57:32
Window.location = prompt('Enter Your URL: ');
0
Author: Илья Головешко, 2011-01-08 21:32:33