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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:45:57+00:00 2026-05-21T11:45:57+00:00

Why does this work: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html xmlns=http://www.w3.org/1999/xhtml>

  • 0

Why does this work:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<div id="graph">
<? include('sites/test.php') ?>
</div>
</body>

But this does not:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<div id="graph">
</div>
<script>
$(document).ready(function() {         
    $('#graph').load('sites/test.php');    
});
</script>
</body>

Here is test.php if required:

<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="./data.js"></script>
<div id="text" style="width:500px;height:500px;position:relative;border:1px solid red;">
<div id="map_canvas" style="border:1px solid green;"></div>
</div>

<script type="text/javascript">
var map;
function initialize() {
    var myLatlng = new google.maps.LatLng(-36.42,145.704);
    var myOptions = { zoom: 16, center: myLatlng, mapTypeId: google.maps.MapTypeId.SATELLITE }

    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    // Create polygon overlays from site data in file data.js included above
    // Overlays are defined by a set of coordinates
    // We will also be setting up an infowindow with the site name
    // The infowindow will be designed to point to the 'center' of each site so we calculate the 'centroid' of each overlay in the code below as well
    var overlay;
    var number_of_overlays = 29;

    for (var k = 0; k < number_of_overlays; k++) {
        var pk = primaryKeys[k];
        var verticesArray = new Array((eval("siteVertices_" + pk).length) / 2);
        var m = 0;
        var centroidLat = 0;
        var centroidLng = 0;

        for (var n = 0; n < eval("siteVertices_" + pk).length; n += 2)
        {
            verticesArray[m] = new google.maps.LatLng(eval("siteVertices_" + pk)[n], eval("siteVertices_" + pk)[n + 1]);
            m = m + 1;
            centroidLat += eval("siteVertices_" + pk)[n];
            centroidLng += eval("siteVertices_" + pk)[n + 1];
        }

        var cent = new google.maps.LatLng(centroidLat/m, centroidLng/m);

        var overlay = new google.maps.Polygon({
            paths: verticesArray,
            strokeColor: "#FF0000",
            strokeOpacity: 0.5,
            strokeWeight: 1,
            fillColor: "#FF0000",
            fillOpacity: 0.20,
            position: cent,
            map:map });

        attachInfoWindow(overlay, k);
    }
}

function attachInfoWindow(overlay, number) {
  var infowindow = new google.maps.InfoWindow({ content: siteNames[number] });
  google.maps.event.addListener(overlay, 'click', function() { infowindow.open(map, overlay); });
}
    window.onload=initialize;
</script>

I really need to use jquery for a click event and can’t understand why .load won’t work.

MTIA!

EDIT – Apologies for the vagueness of “not working”! The initialize function does not seem to uhmmm… initialize. So the window.onload=initialize appears to work using include, but does not seem to work using .load.

I hope this is clearer.

  • 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-21T11:45:58+00:00Added an answer on May 21, 2026 at 11:45 am
    window.onload=initialize;
    

    that will execute on the browser triggering that event – as you load in via jquery that event has long passed. Simply change that line to:

    initialize();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html
i have my doctype set as: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
Why does this not work? Do I not understand delegate covariance correctly? public delegate
Okay I wrapped the divs within a div. Why does this not work? <!DOCTYPE
Does this work well as a Singleton in actionscript? i.e. are there any gotchas
Does this work in > iOS 5? .element { background: url(images/myImage.jpg) 50% 0 no-repeat
Why does this work.... function Person(name) { this.name = name; } Person.prototype.speak = function()
Why does this work: List<?> list = new LinkedList<Integer>(); while this gives a type
why does this work: def function1(): a = 10 def function2(): print a function2()
Why does this work well: cout << foo; While this doesn't? (&cout)->operator<<(foo); It works

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.