Estoy tratando de obtener el enlace href del mapa de Google como se muestra en la captura de pantalla. El enlace está dentro de iframe. Da valor nulo/error de este código a continuación. El mapa de Google está incrustado usando jquery.
Intenté: `
var a_href = $(this).find('div .google-maps-link a').attr('href'); var hrefs = $('#mapDiv .google-maps-link').find('a').attr('href'); var href = $('.google-maps-link').find('a').attr('href'); var values = $("#mapDiv .google-maps-link a").prop('href'); var value = $("#mapDiv .gm-style .place-card .bottom-actions .google-maps-link a").attr('href');
`
Ayúdame.
Actualizar:
<div class="col-md-6" id="map-location"> <div id="dvmap"></div> </div> $(document).ready(function () { $.ajax({ url: "@Url.Content("~/GMap/GetGMapDataInfo")", method: "GET", success: function (result) { var json = JSON.parse(result.data); $("#dvmap").html('<iframe name="frame1" scrolling="no" marginheight="0" marginwidth="0" id="gmap_canvas" src="' + json.MapLocation + '" width="520" height="400" frameborder="0"></iframe>'); }, error: function () { } }); });
Quiero compartir esta ubicación (2880 Broadway)
En Ver mapa grande que está en la etiqueta de anclaje. Necesito este enlace href.
Por razones de seguridad, no puede acceder a la URL de un iframe servido en otro dominio.