File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 99</ head >
1010
1111< body >
12- TEST
12+ < div >
13+ < span id ="tset1 "> </ span > ----
14+ < span id ="tset2 "> </ span >
15+ </ div >
1316</ body >
1417< script >
15- navigator . geolocation . getCurrentPosition ( function ( position ) {
16- longitude = position . coords . longitude ;
17- latitude = position . coords . latitude ;
18- alert ( longitude ) ;
19- alert ( latitude ) ;
20- } )
18+ try {
19+ navigator . geolocation . getCurrentPosition ( function ( position ) {
20+ longitude = position . coords . longitude ;
21+ latitude = position . coords . latitude ;
22+ document . getElementById ( "tset1" ) . innerHTML = longitude ;
23+ document . getElementById ( "tset2" ) . innerHTML = latitude ;
24+ } )
25+ } catch ( error ) {
26+ document . getElementById ( "tset1" ) . innerHTML = error ;
27+ }
2128</ script >
2229
2330</ html >
You can’t perform that action at this time.
0 commit comments