PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 2024 → Using javascript code in webdev
Using javascript code in webdev
Iniciado por Yao Bita, abr., 30 2010 2:06 PM - 2 respostas
Publicado em abril, 30 2010 - 2:06 PM
I am trying for almost two weeks now to insert the google map code in one of my project page. but I am still getting error.
Where and How should I put de code. this is the code I put in the
JS Load(onload) Page_Html1 (Browser)
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>My Locations</title>
<script src="http://maps.google.com/maps?file=api&v=2&
key=ABQIAAAAUC1tsbcu00NWDxEPckkB0xTPbXTe5sO49bVXeCUMXw9iRtDhZxQbmLdD28nd5uvPxjw03Z_8HXKyHw" type="text/javascript"></script>
<script type="text/javascript">

FUNCTION load()
{
IF (GBrowserIsCompatible()) {
var point;
var map=new GMap2(document.getElementById("map"));
map.addControl(new GOverviewMapControl());
map.enableDoubleClickZoom();
map.enableScrollWheelZoom();
map.addControl(new GMapTypeControl());
map.addControl(new GSmallMapControl());
var Address='<img src="myimage.gif" width=150 height=40/><br/>' +
<font size="2" face="Arial"><b>INDIA</b><br/><br/>Home.<br/>' +
new York City<br/><br/>America<br/>Ph.: 23743823</font>';
var Marker = new GMarker(point);
map.setCenter(point,17);
map.addOverlay(Marker);
map.setMapType(G_HYBRID_MAP);
GEvent.addListener(Marker, "click", FUNCTION() {
Marker.openInfoWindowHtml(Address);});
Marker.openInfoWindowHtml(Address);

}
}
</script></head>
<body onload="load();" onunload="GUnload()" style="
background-color:Transparent">
<div id="map" style="width: 900px; height: 500px"></div>
</body>
</html>


WHY IS THIS ERROR .PLEASE HELP!
Publicado em maio, 20 2010 - 12:04 AM
You may have already found a solution but this is what I found out from PCSoft:
When such an error occurs, it can be prevented by adding HTML comments around the Javascript code.
Example :
<script language="javascript">
<!--
var foo= 40;
if (foo> 30 )
{
alert("foobar");
}
//-->
</script>


Hope this helps you or others searching for a solution.
Publicado em junho, 18 2010 - 8:52 AM
thanks Georges!
very helpful. I solved the probleme by another solution. Thanks anyway for your support. keep in touch!
George Clemons wrote in news message <94f45b002190a633cfe9f03f2bcb310d@news.pcsoft>:
You may have already found a solution but this is what I found out from PCSoft:
When such an error occurs, it can be prevented by adding HTML comments around the Javascript code.
Example :
<script language="javascript">
<!--
var foo= 40;
if (foo> 30 )
{
alert("foobar");
}
//-->
</script>


Hope this helps you or others searching for a solution.