You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
1.8 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <script language=javascript>
  5. function show_url()
  6. {
  7. var obj1 = document.getElementById('txturl');
  8. var obj2 = document.getElementById('myiframe');
  9. obj2.src = obj1.value;
  10. }
  11. function show_url2()
  12. {
  13. if (event.keyCode==13) show_url();
  14. return;
  15. }
  16. function getPar(par){
  17. //获取当前URL
  18. var local_url = document.location.href;
  19. //获取要取得的get参数位置
  20. var get = local_url.indexOf(par +"=");
  21. if(get == -1){
  22. return false;
  23. }
  24. //截取字符串
  25. var get_par = local_url.slice(par.length + get + 1);
  26. //判断截取后的字符串是否还有其他get参数
  27. var nextPar = get_par.indexOf("&");
  28. if(nextPar != -1){
  29. get_par = get_par.slice(0, nextPar);
  30. }
  31. return get_par;
  32. }
  33. function show_url3()
  34. {
  35. var curl = getPar('url');
  36. if (curl != '')
  37. {
  38. var obj1 = document.getElementById('txturl');
  39. var obj2 = document.getElementById('myiframe');
  40. obj1.value = curl;
  41. obj2.src = curl;
  42. }
  43. }
  44. </script>
  45. <!-- 百度统计star -->
  46. <script>
  47. var _hmt = _hmt || [];
  48. (function() {
  49. var hm = document.createElement("script");
  50. hm.src = "//hm.baidu.com/hm.js?3d4ede42cef05a99fcd8bda849831ada";
  51. var s = document.getElementsByTagName("script")[0];
  52. s.parentNode.insertBefore(hm, s);
  53. })();
  54. </script>
  55. <!-- 百度统计end -->
  56. </head>
  57. <body onload="show_url3()" >
  58. <input type=text id="txturl" style="width:200px;" value="" onkeypress="show_url2()">
  59. <input type=button id=button1 value="Submit" onclick="show_url()"><br/>
  60. <iframe id="myiframe" style="width:335px;height:800px;border:1px solid #000000;" ></iframe>
  61. </body>
  62. </html>