如何将LatLng从传单添加到WordPress自定义字段?
问题描述:
我使用传单。我有一个从前端添加帖子的表单。我必须获得当前的latlng
坐标并将它们添加到WordPress自定义字段。我想我可以使用像这样的输入如何将LatLng从传单添加到WordPress自定义字段?
document.write('<input type=\'text\' name=\'position\' value = \'' + latlng + '\'');
如何获得latlng
的变量?
答
var positions = document.getElementsByName('position'); //the list of position
var position = positions[i] // the index of position in the document
我改进了格式以提高可读性。 – Ram