繁体   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