Reputation: 37
Is it possible to get javascript var by using Simple html dom or are there other options?
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(11.80991, 1.98722);
var myOptions = {
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
include('simple_html_dom.php');
// Retrieve the DOM from a given URL
$html = file_get_html('url');
I want the lat and lng when i parse the url by Simple Html Dom. Is that possible?
Upvotes: 0
Views: 861
Reputation: 466
I'm not sure what you're looking for. But maybe it's this:
function initialize() {
var latlng = new google.maps.LatLng(11.80991, 1.98722);
var lat = latlng.lat();
document.getElementById('lat').innerHTML = "Latitude: " + lat;
var lang = latlng.lng();
document.getElementById('lang').innerHTML = "Longitude: " + lang;
//Both:
document.getElementById('both').innerHTML = "Lat/Long: " + latlng;
}
window.onload = initialize();
Upvotes: 1