Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7582281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:23:52+00:00 2026-05-30T18:23:52+00:00

i have 3 marker.. can i load example1.html to div1 when clicked to marker1?

  • 0

i have 3 marker.. can i load example1.html to div1 when clicked to marker1? and example2.html to div1 for marker2..

here is my modified demo by @kjy112 http://jsfiddle.net/rD8U6/198/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:23:54+00:00Added an answer on May 30, 2026 at 6:23 pm

    What I am doing is adding an iframe inside your div1. With that in place, I replaced the third item of your myPoints array to the name of the html file or hyperlink you want. (Note you might run into “display forbidden” under x-frame-options, I get that with google.com and am unable to place it into the div/iframe). It should work inside your own domain.

    Make two (simple) static htmls called static_a.html and static_b.html to test the code below. The middle marker should go to New York University’s homepage.

    Given the link for each marker, the div is changed indirectly, from the change in the iframe’s src with $("#myiframe").attr('src', html); in the marker’s click listener.

    <!DOCTYPE html>
    <html>
      <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <style type="text/css">
        html, body {
          margin:0px;
          padding:0px;
          height:100%;
        }
        #map_canvas {
          width:500px;
          height:100%;
        }
        #div1 {
          background-color:#0FC;
          width:300px;
          height:100%;
          position:absolute;
          right:0px;
          top:0px;
          display:none;
        }
        </style>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript">
    var map = null;
    var markerArray = []; //create a global array to store markers
    var myPoints = [[43.65654, -79.90138, 'static_a.html'],
                    [43.91892, -78.89231, 'static_b.html'],
                    [43.82589, -79.10040, 'http://www.nyu.edu']];  //create global array to store points
    
    function initialize() {
        var myOptions = {
            zoom: 8,
            center: new google.maps.LatLng(43.907787, -79.359741),
            mapTypeControl: true,
            mapTypeControlOptions: {
                style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
            },
            navigationControl: true,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
        google.maps.event.addListener(map, 'click', function() {
            infowindow.close();
        });
    
        // Add markers to the map
        // Set up markers based on the number of elements within the myPoints array
        for(var i=0; i<myPoints.length; i++) {
             createMarker(new google.maps.LatLng(myPoints[i][0], myPoints[i][1]), myPoints[i][2]);
        }
    
        //mc.addMarkers(markerArray , true);
    }
    
    var infowindow = new google.maps.InfoWindow({
    });
    
    function createMarker(latlng, html) {
        var contentString = html;
        var marker = new google.maps.Marker({
            position: latlng,
            map: map
        });
    
        google.maps.event.addListener(marker, 'click', function() {
            infowindow.setContent(contentString);
            infowindow.open(map, marker);
            map.panTo(latlng);
            $("#div1").show();
            $("#myiframe").attr('src', html);
    
        });
    
        markerArray.push(marker); //push local var marker into global array
    }
        </script>
      </head>
      <body onload="initialize()">
    <div id="map_canvas"></div>
    <div id="div1"><iframe id="myiframe" style="width: 100%; height: 100%"></iframe>
    </div>
    
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now that I can actually create an SVG marker here is my vision: The
I have marked my DLL as vsdraCOM, and I can see it in the
i have released a version 1 on some app in the market. Can anyone
I have a marker interface defined as public interface IExtender<T> { } I have
I have a simple marker annotation for methods (similar to the first example in
I have a rather large SQL file which starts with the byte order marker
I have an application that uses CoreData. I previously had a class named Marker
HI, I have a Mapview with some marker points + a marker for current
Problem I have a API V3 map, with a content window for each marker.
My application have to load some points from internal sqlite database of android, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.