두 변수를 가져 오는 Javascript 함수가 있습니다. 그런 다음 JS가 HTML 행을 생성하도록했습니다.이 양식은이 두 변수로 채워집니다. 필자는 서버에 게시 할 메서드를 설정하고 양식은 숨겨져 있습니다. 난 정말 제출 버튼을 사용하고 싶지 않아 자동으로 제출이 어떻게해야합니까 궁금 해서요.자동 HTML 양식 제출
var x=document.getElementById("demo");
function getLocation()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(showPosition);
document.geo.submit()
}
else{x.innerHTML="Geolocation is not supported by this browser.";}
}
function showPosition(position)
{
x.innerHTML=
"<form action='' name='geo' method='post'> Longitude: <input type='int' name='longitude' value='"+ position.coords.longitude +"'> Latitude: <input type='int' name='latitude' value='"+ position.coords.latitude +"'> </form> ";
}
많은 감사 - 조
당신이 – Pete
을 한 일의 일부 코드를 게시하시기 바랍니다 당신이 봤어 <몸의 온로드 = "SubmitForm에은()"> 여기 좋아 – Jefferson
은 '내 JS의 동적 – user2166941