Results 1 to 6 of 6

Thread: Ajaxtab is not displaying external page which contains google map

  1. #1
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajaxtab is not displaying external page which contains google map

    1) Script Title:
    Ajax Tabs Content

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tent/index.htm

    3) Describe problem:

    Hi All,

    I am new to AJAX so please help me out here. I am using DD Ajaxtab in above link and trying to add an external page on one of the page which contains google map using google API. Code of that external page is displayed below. How can I make it work. All other tab content works fine except this one. Please Help and THANKS in advance.




    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=[mykey which I have removed];
    type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    function load() {
    if (GBrowserIsCompatible()) {

    //take last ll attributes from link to this page url of the map
    var map = new GMap2(document.getElementById("map").href="greenacres_maps.html");
    map.setCenter(new GLatLng(40.268791,-74.876836), 14);
    map.addOverlay(new GMarker(new GLatLng(40.268791,-74.876836)));

    }
    }
    //]]>
    </script>
    </head>
    <body onload="load()" onunload="GUnload()">
    <table width=500 border="1">
    <tr><td width="500">
    <div id="map" style="width: 500px; height: 300px"></div>

    </table>
    </body>
    </html>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Since Google Maps contains JavaScript that is rendered at run time, when fetched via Ajax, it will no longer work. What you can do is first create a blank HTML page (ie: externalpage.htm), then inside it, create a <iframe> tag that calls the actual Google Maps page: (ie: googlemap.htm). Something like:

    Code:
    <iframe src="googlemap.htm" style="margin:0; padding:0; width:100&#37;; height: 100%"></iframe>
    Then inside the Ajax Tabs script, have one of the tabs call externalpage.htm.

  3. #3
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up thanks much for the suggestion ...it worked!!

    ddadmin...Thanks for the easy yet very good and elegent workaround. It is working great !!!

  4. #4
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey guys,

    sorry to dig this back up, but i'm having some trouble that an iframe won't fix...

    www.caseywight.com/orionsphoto/index.php is where i'm stuck

    i'm using the dynamic ajax loading script to load from the flash header into the content div, and when a user goes from one page to another it works great! except... if you go from any of the pages, back to home - the flash doesn't show up

    does ANYONE KNOW how i can create a force-load, or perhaps make this ajax script NOT check to see if it's loaded it before. I have no problem with it taking a little while longer for these pages to load up, if there is a way to remove the check-to-see-if-content-has-been-loaded part.

    but i'm no ajax programmer

    can i get some help??

    thanks!!!!!!

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sunshine, I don't see Ajax Tabs content running on that page actually.

  6. #6
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hot damn!

    sorry guys, i realized i posted to the wrong thread, then i realized i could fix it without this ajax stuff :P

    thanks anyway!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •