FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WEBDEV 2024
→
Using javascript code in webdev
Using javascript code in webdev
Débuté par Yao Bita, 30 avr. 2010 14:06 - 2 réponses
Connectez-vous…
Yao Bita
#1
Posté le 30 avril 2010 - 14:06
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!
Signaler
0
0
George Clemons
#2
Posté le 20 mai 2010 - 00:04
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.
Signaler
0
0
yaobita
#3
Posté le 18 juin 2010 - 08:52
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.
Signaler
0
0
→ Revenir à WEBDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte