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 735729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:31:25+00:00 2026-05-14T07:31:25+00:00

I’m working on a GMaps application to retrieve images, via getJSON(), and to populate

  • 0

I’m working on a GMaps application to retrieve images, via getJSON(), and to populate a popup marker.

The following is the markup which I add to the marker dynamically:

<div id="images"></div>                 
<div id="CampWindow" style="display:none;width:550px;height:500px;">
<h4 id="camp-title"></h4>
<p>View... (all links open in new windows)</p>
<ul>
    <li><a id="camp-hp-link" target="_blank" href="">camp home page</a></li>
    <li>information: <a id="camp-av-link" target="_blank" href="">availability</a> | <a id="camp-vi-link" target="_blank" href="">vital information</li>
</ul>
<p id="message"></p>

I’ve been clawing out my eyes and woohoo for the past couple of days, trying to get the images to show inside the CampWindow . Then, I decided to think laterally and to see if the images were being retrieved at all. I then moved the images outside and sure as Bob (Hope), the images were being retrieved and refreshed with every click.

So, I decided to the keep the images outside and then once loaded, append it to the CampWindow . It’s not working still; when I append the div to the main CampWindow div, the images won’t show. I check in Firebug with the pointer thingy and it shows me the images as empty. I try it again with the images outside and it shows the images. I’ve tried before append and appendTo with no success. Am I missing something here?

I have no more woohoo to claw out. Please, please help.

  marker.clicked = function(marker){
    $("#images").html('');
    $('#camp-title').text(this.name);
    $('#camp-hp-link').attr('href', this.url);
    $('#camp-av-link').attr('href', this.url + '/tourism/availability.php');
    $('#camp-vi-link').attr('href', this.url + '/tourism/general.php');          

    // get resort images via jQuery AJAX call - includes/GetResortImages.inc.php
    $.getJSON('./includes/GetResortImages.inc.php', { park: this.park_name, camp: this.camp_name }, RetrieveImages);

    function RetrieveImages (data)
    {
      if ('failed' == data.status)
      {
        $('#messages').append("<em>We don't have any images for this rest camp right now!</em>");
      }
      else
      {
        if ('' != data.camp)
        {   
          $.each(data, function(key,value){
              $("<img/>").attr("src", value).appendTo('#images');
          }); 
        }
      }
    }
          //.append($("#images"));
    $("#CampWindow").show(); 
    var windowContent = $("<html />");              
    $("#CampWindow").appendTo(windowContent);        

    var infoWindowAnchor = marker.getIcon().infoWindowAnchor;
    var iconAnchor = marker.getIcon().iconAnchor;
    var offset = new google.maps.Size(infoWindowAnchor.x-iconAnchor.x,infoWindowAnchor.y-iconAnchor.y);
    map.openInfoWindowHtml(marker.getLatLng(), windowContent.html(), {pixelOffset:offset});             
  }
  markers.push(marker);
});
  • 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-14T07:31:25+00:00Added an answer on May 14, 2026 at 7:31 am

    When you add the <html> tag to your page it confuses the browser and is most likely the problem. I would suggest to either do as Pointy said and use window.open() to make a popup window (check out this tutorial), or better yet try out one of the many jQuery light box plugins.


    I’m not sure what you are doing with the google maps, so I decided to just go with a basic example for you. With this script, if you click on an image inside the #image div, it’ll open a popup window the same size as the image.

    $(document).ready(function(){
     $('#images img').click(function(){
      var padding = 20;
      var w = $(this).width() + padding;
      var h = $(this).height() + padding;
      var popup = '\
       <html>\
        <head>\
         <link type="text/css" href="popup-style.css" rel="stylesheet" />\
         <scr'+'ipt type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></scr'+'ipt>\
        </head>\
        <body>\
        <img src="' + $(this).attr('src') + '">\
        </body>\
       </html>';
      var pop = window.open('','Image View','toolbar=0,location=0,status=0,width=' + w + ',height=' + h + ',scrollbars=1,resizable=1');
      pop.document.write(popup);
      pop.document.close();
     })
    });
    

    NOTE: When adding a script tag inside a string, make sure you break up the word “script” otherwise you will get an error.


    Update #2:
    Ok, since you want to work with what you have, try doing this:

    Remove the <html> tag from your campwindow, then position your campwindow using CSS and/or javascript. Add something like:

     var w = $(window).width();
     var h = $(window).height();
     // Add overlay and make clickable to hide popup
     // you can remove the background color and opacity if you want to make it invisible
     var $overlay = $('<div/>', {
      'id': 'overlay',
      css: {
       position   : 'absolute',
       height     : h + 'px',
       width      : w + 'px',
       left       : 0,
       top        : 0,
       background : '#000',
       opacity    : 0.5,
       zIndex     : 99
      }
     }).appendTo('body');
     // Position your popup window in the viewport
     $('#CampWindow').css({
      position: 'absolute',
      top     : $(window).scrollTop() + 50 + 'px',
      left    : w/2 - $('#CampWindow').width()/2 + 'px', // centers the popup
      zIndex  : 100
     })
     .fadeIn('slow');
     // Click overlay to hide popup
     $('#overlay').click(function(){
      $('#CampWindow').hide();
      $(this).remove(); // remove the overlay
     })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.