簡體   English   中英

抓取到HTML文本框的鏈接

[英]Grab link to html textbox

我有此鏈接-http://am3yar0ra.in/test.html?a=52.472565,13.457407,名稱

現在,我需要讀取我的test.html文件並將a = 52.472565,13.457407,Name添加到文本框中並自動更新值。

這樣它就可以通過單擊“單擊我!”來檢測URL協議 在test.html中


對不起,我的英語不好。 將會有很大的幫助。

<center><font size="40"><b>Test</b></font></center>


<br><br><br>

<a href="test://Name/52.472565,13.457407">Click Me!!</a><br>

<br>Mouse Over Select Name: <b></b>
<br><input type="text" style="height:20px;line-height:10px;color:green;" onclick="this.setSelectionRange(0, this.value.length);" size="25" value="Name" readonly="">

<br>Mouse Over Select Lat &amp; Lon: <b></b>
<br><input type="text" style="height:20px;line-height:10px;color:green;" onclick="this.setSelectionRange(0, this.value.length);" size="25" value="52.472565,13.457407" readonly="">

<br>Mouse over to Select Data: <b></b>
<br><input type="text" style="height:20px;line-height:10px;color:green;" onclick="this.setSelectionRange(0, this.value.length);" size="45" value="test://Name/52.472565,13.457407" readonly="">

找到了我想要的答案。 是在PHP中完成的嗎..

<?php
$location = $_GET['a'];
$locationSplit = explode(",", $location);
$lat = $locationSplit[0];
$lng = $locationSplit[1];
$name = $locationSplit[2];
$fullLocation = $lat.",". $lng;
// if latitude is between -90 / -180 <= lat / lng <= 90 / 180
// if (those checks are false)
//     die(0)
?>

嘗試這個:

setInterval(change,1000/30);
function change() {
  var x = document.getElementById('change');
  x.setAttribute("onclick","location.href='test://Name/52.472565,13.457407'");
}     

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM