|
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <script language=javascript>
- function show_url()
- {
- var obj1 = document.getElementById('txturl');
- var obj2 = document.getElementById('myiframe');
- obj2.src = obj1.value;
- }
- function show_url2()
- {
- if (event.keyCode==13) show_url();
- return;
- }
- function getPar(par){
- //获取当前URL
- var local_url = document.location.href;
- //获取要取得的get参数位置
- var get = local_url.indexOf(par +"=");
- if(get == -1){
- return false;
- }
- //截取字符串
- var get_par = local_url.slice(par.length + get + 1);
- //判断截取后的字符串是否还有其他get参数
- var nextPar = get_par.indexOf("&");
- if(nextPar != -1){
- get_par = get_par.slice(0, nextPar);
- }
- return get_par;
- }
- function show_url3()
- {
- var curl = getPar('url');
- if (curl != '')
- {
- var obj1 = document.getElementById('txturl');
- var obj2 = document.getElementById('myiframe');
- obj1.value = curl;
- obj2.src = curl;
- }
- }
- </script>
- <!-- 百度统计star -->
- <script>
- var _hmt = _hmt || [];
- (function() {
- var hm = document.createElement("script");
- hm.src = "//hm.baidu.com/hm.js?3d4ede42cef05a99fcd8bda849831ada";
- var s = document.getElementsByTagName("script")[0];
- s.parentNode.insertBefore(hm, s);
- })();
- </script>
-
- <!-- 百度统计end -->
-
- </head>
- <body onload="show_url3()" >
- <input type=text id="txturl" style="width:200px;" value="" onkeypress="show_url2()">
- <input type=button id=button1 value="Submit" onclick="show_url()"><br/>
- <iframe id="myiframe" style="width:335px;height:800px;border:1px solid #000000;" ></iframe>
- </body>
- </html>
|