2015-06-22 142 views
0

我使用傳單。我有一個從前端添加帖子的表單。我必須獲得當前的latlng座標並將它們添加到WordPress自定義字段。我想我可以使用像這樣的輸入如何將LatLng從傳單添加到WordPress自定義字段?

document.write('<input type=\'text\' name=\'position\' value = \'' + latlng + '\''); 

如何獲得latlng的變量?

+0

我改進了格式以提高可讀性。 – Ram

回答

0
var positions = document.getElementsByName('position'); //the list of position 
var position = positions[i] // the index of position in the document 
相關問題