This XML file does not appear to have any style information associated with it. The document tree is shown below.,

2,878 views
Skip to first unread message

Magnus

unread,
May 5, 2011, 5:56:46 AM5/5/11
to google-map...@googlegroups.com
Hi,
I used the source code from this example:
http://code.google.com/apis/maps/documentation/javascript/examples/map-simple-async.html
added the CDATA like this to get around an error
 // <![CDATA[
    script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
 // ]]>
but now I get the following eroor in Firefox:
This XML file does not appear to have any style information associated with it. The document tree is shown below.,
And in Chrome 11 I just get this as an output on the screen(firefox gives it an XML structure).
html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 500px;width: 400px } Google Maps JavaScript API v3 Example: Map Simple function initialize() { var myLatlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } function loadScript() { var script = document.createElement("script"); script.type = "text/javascript"; // document.body.appendChild(script); } window.onload = loadScript;

Ive been trying to get Google Maps to my page for two days now but all I've managed is an embedded picture, please help!

Here is my page:
http://people.dsv.su.se/~mk2/ip3/6/maps.xhtml

Best Regards
Magnus

Radina

unread,
May 5, 2011, 2:32:21 PM5/5/11
to Google Maps JavaScript API v3
Magnus:
Just change extension to .html (should be maps.html)
Thanks, Radina

On May 5, 2:56 am, Magnus <magnus8...@gmail.com> wrote:
> Hi,
> I used the source code from this example:http://code.google.com/apis/maps/documentation/javascript/examples/ma...
> added the CDATA like this to get around an error
>   // <![CDATA[
>      script.src =
> "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
>   // ]]>
> but now I get the following eroor in Firefox:
> This XML file does not appear to have any style information associated
> with it. The document tree is shown below.,
> And in Chrome 11 I just get this as an output on the screen(firefox
> gives it an XML structure).
> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px }
> #map_canvas { height: 500px;width: 400px } Google Maps JavaScript API v3
> Example: Map Simple function initialize() { var myLatlng = new
> google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center:
> myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new
> google.maps.Map(document.getElementById("map_canvas"), myOptions); }
> function loadScript() { var script = document.createElement("script");
> script.type = "text/javascript"; // document.body.appendChild(script); }
> window.onload = loadScript;
>
> Ive been trying to get Google Maps to my page for two days now but all
> I've managed is an embedded picture, please help!
>
> Here is my page:http://people.dsv.su.se/~mk2/ip3/6/maps.xhtml
> <http://people.dsv.su.se/%7Emk2/ip3/6/maps.xhtml>
>
> Best Regards
> Magnus

Magnus

unread,
May 5, 2011, 3:41:56 PM5/5/11
to google-map...@googlegroups.com
Thanks, now it works!
Reply all
Reply to author
Forward
0 new messages